=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js' --- src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js 2015-08-26 20:57:51 +0000 +++ src/com/goldencode/p2j/ui/client/gui/driver/web/res/p2j.screen.js 2015-08-26 21:32:06 +0000 @@ -871,6 +871,7 @@ var y1 = p2j.socket.readInt32BinaryMessage(message, idx + 5); var x2 = p2j.socket.readInt32BinaryMessage(message, idx + 9); var y2 = p2j.socket.readInt32BinaryMessage(message, idx + 13); + extra = " x1 = " + x1 +"; y1 = " + y1 + "; x2 = " + x2 + "; y2 = " + y2; path = this.drawLine(this.ctx, x1, y1, x2, y2, this.rawColor); strokesManager.applyStrokeToPath(this.ctx, @@ -878,7 +879,6 @@ this.strokeWidth, this.rawColor, path); - this.ctx.stroke(); break; case ops.DRAW_RECT: x = p2j.socket.readInt32BinaryMessage(message, idx + 1); @@ -900,6 +900,7 @@ width = p2j.socket.readInt32BinaryMessage(message, idx + 9); height = p2j.socket.readInt32BinaryMessage(message, idx + 13); diameter = p2j.socket.readInt32BinaryMessage(message, idx + 17); + extra = " x = " + x +"; y = " + y + "; width = " + width + "; height = " + height + "; diameter = " + diameter; this.drawRoundRect(ctx, x, y, width, height, diameter, this.rawColor, false); break; case ops.DRAW_IMAGE: @@ -960,7 +961,13 @@ yPoints[j] = p2j.socket.readInt32BinaryMessage(message, offset); } - this.drawPolygon(this.ctx, xPoints, yPoints, numPoints, this.rawColor, true); + var path = this.drawPolygon(this.ctx, xPoints, yPoints, numPoints, this.rawColor, true); + strokesManager.applyStrokeToPath(this.ctx, + this.strokeStyleId, + this.strokeWidth, + this.rawColor, + path); + break; case ops.DRAW_3D_RECT: case ops.FILL_3D_RECT: @@ -1036,6 +1043,7 @@ y = p2j.socket.readInt32BinaryMessage(message, idx + 5); this.canvas.style.left = x.toString() + "px"; this.canvas.style.top = y.toString() + "px"; + extra = " x = " + x +"; y = " + y; break; case ops.RESIZE_WINDOW: width = p2j.socket.readInt32BinaryMessage(message, idx + 1); @@ -1116,7 +1124,6 @@ } logstack.push("PaintPrimitives." + ops[type] + " " + extra); - idx += sz; } @@ -1472,23 +1479,25 @@ ctx.beginPath(); ctx.rect(x, y, width - inset, height - inset); renderClosedPath(ctx, fill); - } - - // now overdraw the stroked portion to eliminate anti-aliasing, we draw in a - // clockwise direction (since we are not using paths, this is not strictly necessary) - var path = this.drawLine(ctx, x, y, x + width - inset, y, color); - - var more = this.drawLine(ctx, x + width - inset, y + 1, x + width - inset, y + height - inset, color); - Array.prototype.push.apply(path, more); - - more = this.drawLine(ctx, x + width - 1 - inset, y + height - inset, x + 1, y + height - inset, color); - Array.prototype.push.apply(path, more); - - // close the path - more = this.drawLine(ctx, x, y + height - inset, x, y + 1, color); - Array.prototype.push.apply(path, more); - - return path; + return []; + } + else + { + // now overdraw the stroked portion to eliminate anti-aliasing, we draw in a + // clockwise direction (since we are not using paths, this is not strictly necessary) + var path = this.drawLine(ctx, x, y, x + width - inset, y, color); + + var more = this.drawLine(ctx, x + width - inset, y + 1, x + width - inset, y + height - inset, color); + Array.prototype.push.apply(path, more); + + more = this.drawLine(ctx, x + width - 1 - inset, y + height - inset, x + 1, y + height - inset, color); + Array.prototype.push.apply(path, more); + + // close the path + more = this.drawLine(ctx, x, y + height - inset, x, y + 1, color); + Array.prototype.push.apply(path, more); + return path; + } }; /** @@ -1768,10 +1777,19 @@ renderClosedPath(ctx, fill); // overdraw the anti-aliased line segments - this.drawLine(ctx, topLeftX, topLeftY, topRightX, topRightY, color); - this.drawLine(ctx, rightUpX, rightUpY, rightDownX, rightDownY, color); - this.drawLine(ctx, bottomLeftX, bottomLeftY, bottomRightX, bottomRightY, color); - this.drawLine(ctx, leftUpX, leftUpY, leftDownX, leftDownY, color); + + var path = this.drawLine(ctx, topLeftX, topLeftY, topRightX, topRightY, color); + var more = this.drawLine(ctx, rightUpX, rightUpY, rightDownX, rightDownY, color); + Array.prototype.push.apply(path, more); + more = this.drawLine(ctx, bottomLeftX, bottomLeftY, bottomRightX, bottomRightY, color); + Array.prototype.push.apply(path, more); + more = this.drawLine(ctx, leftUpX, leftUpY, leftDownX, leftDownY, color); + Array.prototype.push.apply(path, more); + strokesManager.applyStrokeToPath(this.ctx, + this.strokeStyleId, + this.strokeWidth, + color, + path); }; /** @@ -1832,6 +1850,7 @@ ctx.fillStyle = createColorString(current); ctx.beginPath(); ctx.rect(x, y, width, height); + renderClosedPath(ctx, fill); } @@ -1839,14 +1858,26 @@ // draw the top and left sides in the contrasting color (raised mode) or the darker color // otherwise - this.drawLine(ctx, x + 2, y, x + width - 1, y, current); - this.drawLine(ctx, x + 1, y + 1, x + 1, y + height - 1, current); - + var path = this.drawLine(ctx, x + 2, y, x + width - 1, y, current); + var more = this.drawLine(ctx, x + 1, y + 1, x + 1, y + height - 1, current); + Array.prototype.push.apply(path, more); + strokesManager.applyStrokeToPath(this.ctx, + this.strokeStyleId, + this.strokeWidth, + current, + path); + // draw the bottom and right sides in the darker color (raised mode) or the contrasting // color otherwise current = raised ? darker : lighter; - this.drawLine(ctx, x + 2, y + height - 1, x + width, y + height - 1, current); - this.drawLine(ctx, x + width, y, x + width, y + height - 2, current); + path = this.drawLine(ctx, x + 2, y + height - 1, x + width, y + height - 1, current); + more = this.drawLine(ctx, x + width, y, x + width, y + height - 2, current); + Array.prototype.push.apply(path, more); + strokesManager.applyStrokeToPath(this.ctx, + this.strokeStyleId, + this.strokeWidth, + current, + path); // clear the clipping region ctx.restore(); @@ -1889,12 +1920,14 @@ ctx.closePath(); renderClosedPath(ctx, fill); } - + var path = []; // now overdraw the stroked portion for (i = 0; i < (num - 1); i++) { - this.drawLine(ctx, xPoints[i], yPoints[i], xPoints[i + 1], yPoints[i + 1], color); + var more = this.drawLine(ctx, xPoints[i], yPoints[i], xPoints[i + 1], yPoints[i + 1], color); + Array.prototype.push.apply(path, more); } + return path; }; /**