1
|
=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js'
|
2
|
--- src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js 2015-08-26 20:57:51 +0000
|
3
|
+++ src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js 2015-08-26 21:32:06 +0000
|
4
|
@@ -871,6 +871,7 @@
|
5
|
var y1 = p2j.socket.readInt32BinaryMessage(message, idx + 5);
|
6
|
var x2 = p2j.socket.readInt32BinaryMessage(message, idx + 9);
|
7
|
var y2 = p2j.socket.readInt32BinaryMessage(message, idx + 13);
|
8
|
+ extra = " x1 = " + x1 +"; y1 = " + y1 + "; x2 = " + x2 + "; y2 = " + y2;
|
9
|
path = this.drawLine(this.ctx, x1, y1, x2, y2, this.rawColor);
|
10
|
|
11
|
strokesManager.applyStrokeToPath(this.ctx,
|
12
|
@@ -878,7 +879,6 @@
|
13
|
this.strokeWidth,
|
14
|
this.rawColor,
|
15
|
path);
|
16
|
- this.ctx.stroke();
|
17
|
break;
|
18
|
case ops.DRAW_RECT:
|
19
|
x = p2j.socket.readInt32BinaryMessage(message, idx + 1);
|
20
|
@@ -900,6 +900,7 @@
|
21
|
width = p2j.socket.readInt32BinaryMessage(message, idx + 9);
|
22
|
height = p2j.socket.readInt32BinaryMessage(message, idx + 13);
|
23
|
diameter = p2j.socket.readInt32BinaryMessage(message, idx + 17);
|
24
|
+ extra = " x = " + x +"; y = " + y + "; width = " + width + "; height = " + height + "; diameter = " + diameter;
|
25
|
this.drawRoundRect(ctx, x, y, width, height, diameter, this.rawColor, false);
|
26
|
break;
|
27
|
case ops.DRAW_IMAGE:
|
28
|
@@ -960,7 +961,13 @@
|
29
|
yPoints[j] = p2j.socket.readInt32BinaryMessage(message, offset);
|
30
|
}
|
31
|
|
32
|
- this.drawPolygon(this.ctx, xPoints, yPoints, numPoints, this.rawColor, true);
|
33
|
+ var path = this.drawPolygon(this.ctx, xPoints, yPoints, numPoints, this.rawColor, true);
|
34
|
+ strokesManager.applyStrokeToPath(this.ctx,
|
35
|
+ this.strokeStyleId,
|
36
|
+ this.strokeWidth,
|
37
|
+ this.rawColor,
|
38
|
+ path);
|
39
|
+
|
40
|
break;
|
41
|
case ops.DRAW_3D_RECT:
|
42
|
case ops.FILL_3D_RECT:
|
43
|
@@ -1036,6 +1043,7 @@
|
44
|
y = p2j.socket.readInt32BinaryMessage(message, idx + 5);
|
45
|
this.canvas.style.left = x.toString() + "px";
|
46
|
this.canvas.style.top = y.toString() + "px";
|
47
|
+ extra = " x = " + x +"; y = " + y;
|
48
|
break;
|
49
|
case ops.RESIZE_WINDOW:
|
50
|
width = p2j.socket.readInt32BinaryMessage(message, idx + 1);
|
51
|
@@ -1116,7 +1124,6 @@
|
52
|
}
|
53
|
|
54
|
logstack.push("PaintPrimitives." + ops[type] + " " + extra);
|
55
|
-
|
56
|
idx += sz;
|
57
|
}
|
58
|
|
59
|
@@ -1472,23 +1479,25 @@
|
60
|
ctx.beginPath();
|
61
|
ctx.rect(x, y, width - inset, height - inset);
|
62
|
renderClosedPath(ctx, fill);
|
63
|
- }
|
64
|
-
|
65
|
- // now overdraw the stroked portion to eliminate anti-aliasing, we draw in a
|
66
|
- // clockwise direction (since we are not using paths, this is not strictly necessary)
|
67
|
- var path = this.drawLine(ctx, x, y, x + width - inset, y, color);
|
68
|
-
|
69
|
- var more = this.drawLine(ctx, x + width - inset, y + 1, x + width - inset, y + height - inset, color);
|
70
|
- Array.prototype.push.apply(path, more);
|
71
|
-
|
72
|
- more = this.drawLine(ctx, x + width - 1 - inset, y + height - inset, x + 1, y + height - inset, color);
|
73
|
- Array.prototype.push.apply(path, more);
|
74
|
-
|
75
|
- // close the path
|
76
|
- more = this.drawLine(ctx, x, y + height - inset, x, y + 1, color);
|
77
|
- Array.prototype.push.apply(path, more);
|
78
|
-
|
79
|
- return path;
|
80
|
+ return [];
|
81
|
+ }
|
82
|
+ else
|
83
|
+ {
|
84
|
+ // now overdraw the stroked portion to eliminate anti-aliasing, we draw in a
|
85
|
+ // clockwise direction (since we are not using paths, this is not strictly necessary)
|
86
|
+ var path = this.drawLine(ctx, x, y, x + width - inset, y, color);
|
87
|
+
|
88
|
+ var more = this.drawLine(ctx, x + width - inset, y + 1, x + width - inset, y + height - inset, color);
|
89
|
+ Array.prototype.push.apply(path, more);
|
90
|
+
|
91
|
+ more = this.drawLine(ctx, x + width - 1 - inset, y + height - inset, x + 1, y + height - inset, color);
|
92
|
+ Array.prototype.push.apply(path, more);
|
93
|
+
|
94
|
+ // close the path
|
95
|
+ more = this.drawLine(ctx, x, y + height - inset, x, y + 1, color);
|
96
|
+ Array.prototype.push.apply(path, more);
|
97
|
+ return path;
|
98
|
+ }
|
99
|
};
|
100
|
|
101
|
/**
|
102
|
@@ -1768,10 +1777,19 @@
|
103
|
renderClosedPath(ctx, fill);
|
104
|
|
105
|
// overdraw the anti-aliased line segments
|
106
|
- this.drawLine(ctx, topLeftX, topLeftY, topRightX, topRightY, color);
|
107
|
- this.drawLine(ctx, rightUpX, rightUpY, rightDownX, rightDownY, color);
|
108
|
- this.drawLine(ctx, bottomLeftX, bottomLeftY, bottomRightX, bottomRightY, color);
|
109
|
- this.drawLine(ctx, leftUpX, leftUpY, leftDownX, leftDownY, color);
|
110
|
+
|
111
|
+ var path = this.drawLine(ctx, topLeftX, topLeftY, topRightX, topRightY, color);
|
112
|
+ var more = this.drawLine(ctx, rightUpX, rightUpY, rightDownX, rightDownY, color);
|
113
|
+ Array.prototype.push.apply(path, more);
|
114
|
+ more = this.drawLine(ctx, bottomLeftX, bottomLeftY, bottomRightX, bottomRightY, color);
|
115
|
+ Array.prototype.push.apply(path, more);
|
116
|
+ more = this.drawLine(ctx, leftUpX, leftUpY, leftDownX, leftDownY, color);
|
117
|
+ Array.prototype.push.apply(path, more);
|
118
|
+ strokesManager.applyStrokeToPath(this.ctx,
|
119
|
+ this.strokeStyleId,
|
120
|
+ this.strokeWidth,
|
121
|
+ color,
|
122
|
+ path);
|
123
|
};
|
124
|
|
125
|
/**
|
126
|
@@ -1832,6 +1850,7 @@
|
127
|
ctx.fillStyle = createColorString(current);
|
128
|
ctx.beginPath();
|
129
|
ctx.rect(x, y, width, height);
|
130
|
+
|
131
|
renderClosedPath(ctx, fill);
|
132
|
}
|
133
|
|
134
|
@@ -1839,14 +1858,26 @@
|
135
|
|
136
|
// draw the top and left sides in the contrasting color (raised mode) or the darker color
|
137
|
// otherwise
|
138
|
- this.drawLine(ctx, x + 2, y, x + width - 1, y, current);
|
139
|
- this.drawLine(ctx, x + 1, y + 1, x + 1, y + height - 1, current);
|
140
|
-
|
141
|
+ var path = this.drawLine(ctx, x + 2, y, x + width - 1, y, current);
|
142
|
+ var more = this.drawLine(ctx, x + 1, y + 1, x + 1, y + height - 1, current);
|
143
|
+ Array.prototype.push.apply(path, more);
|
144
|
+ strokesManager.applyStrokeToPath(this.ctx,
|
145
|
+ this.strokeStyleId,
|
146
|
+ this.strokeWidth,
|
147
|
+ current,
|
148
|
+ path);
|
149
|
+
|
150
|
// draw the bottom and right sides in the darker color (raised mode) or the contrasting
|
151
|
// color otherwise
|
152
|
current = raised ? darker : lighter;
|
153
|
- this.drawLine(ctx, x + 2, y + height - 1, x + width, y + height - 1, current);
|
154
|
- this.drawLine(ctx, x + width, y, x + width, y + height - 2, current);
|
155
|
+ path = this.drawLine(ctx, x + 2, y + height - 1, x + width, y + height - 1, current);
|
156
|
+ more = this.drawLine(ctx, x + width, y, x + width, y + height - 2, current);
|
157
|
+ Array.prototype.push.apply(path, more);
|
158
|
+ strokesManager.applyStrokeToPath(this.ctx,
|
159
|
+ this.strokeStyleId,
|
160
|
+ this.strokeWidth,
|
161
|
+ current,
|
162
|
+ path);
|
163
|
|
164
|
// clear the clipping region
|
165
|
ctx.restore();
|
166
|
@@ -1889,12 +1920,14 @@
|
167
|
ctx.closePath();
|
168
|
renderClosedPath(ctx, fill);
|
169
|
}
|
170
|
-
|
171
|
+ var path = [];
|
172
|
// now overdraw the stroked portion
|
173
|
for (i = 0; i < (num - 1); i++)
|
174
|
{
|
175
|
- this.drawLine(ctx, xPoints[i], yPoints[i], xPoints[i + 1], yPoints[i + 1], color);
|
176
|
+ var more = this.drawLine(ctx, xPoints[i], yPoints[i], xPoints[i + 1], yPoints[i + 1], color);
|
177
|
+ Array.prototype.push.apply(path, more);
|
178
|
}
|
179
|
+ return path;
|
180
|
};
|
181
|
|
182
|
/**
|
183
|
|