Index: web/client/scripts/draw.js =================================================================== --- web/client/scripts/draw.js (revision 6564) +++ web/client/scripts/draw.js (revision 6565) @@ -27,6 +27,10 @@ this.cc.clearRect(0, 0, this.cc.canvas.width, this.cc.canvas.height); //this.cc.globalAlpha = 0.5; + this.board = { + width: 0, + height: 0 + }; this.GCs = new Array(GC_MAX_COUNT); this.gc = undefined; this.mask = "off"; @@ -88,6 +92,8 @@ return; case "unit": this.setUnit(args[0]); return; + case "brddim": this.boardDimensions(Number(args[0]), Number(args[1])); + return; case "ver": this.version(Number(args[0])); return; default: this.comm.error("unknown command: " + command); @@ -247,8 +253,11 @@ }; } GraphicEngine.prototype.setLayerGroup = function (id, empty) { - if (this.currentLayerGroup && this.currentLayerGroup.isMask) { + if (this.enableDraw && this.currentLayerGroup && this.currentLayerGroup.isMask) { + this.maskCc.setTransform(1, 0, 0, 1, 0, 0); + this.mainCc.setTransform(1, 0, 0, 1, 0, 0); this.mainCc.drawImage(this.maskCc.canvas, 0, 0); + this.setMatrix(); this.cc = this.mainCc; } this.currentLayerGroup = this.layerGroups[id]; @@ -262,9 +271,15 @@ } } } - if (this.currentLayerGroup && this.currentLayerGroup.isMask) { + if (this.enableDraw && this.currentLayerGroup && this.currentLayerGroup.isMask) { this.cc = this.maskCc; + this.mainCc.setTransform(1, 0, 0, 1, 0, 0); this.cc.clearRect(0, 0, this.cc.canvas.width, this.cc.canvas.height); + this.setMatrix(); + this.cc.save(); + this.cc.fillStyle = this.colors.mask; + this.cc.fillRect(0, 0, this.board.width, this.board.height); + this.cc.restore(); } } GraphicEngine.prototype.makeGC = function () { @@ -339,6 +354,10 @@ } this.unit = unit; } +GraphicEngine.prototype.boardDimensions = function (w, h) { + this.board.width = w; + this.board.height = h; +} function nanometerPerUnit(unit) { Index: web/testclient/draw.js =================================================================== --- web/testclient/draw.js (revision 6564) +++ web/testclient/draw.js (revision 6565) @@ -33,6 +33,7 @@ mainCc: mainCc, maskCc: maskCc, colors: { + mask: "#274f29" }, purposeMap: { mask: { hidden: true },