From b7063c4ca906a26459dcda90b5946599c3b855d6 Mon Sep 17 00:00:00 2001 From: Lewis Hemens Date: Wed, 8 Jan 2014 22:02:47 +0000 Subject: [PATCH] Fixed offset transformation issue --- js-lib/view.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js-lib/view.js b/js-lib/view.js index 5644a13..c1688ac 100644 --- a/js-lib/view.js +++ b/js-lib/view.js @@ -30,7 +30,6 @@ asciiflow.View.prototype.drawState = function() { // Clear the visible area. this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); - this.context.translate(-this.offsetX/this.zoom, -this.offsetY/this.zoom); this.context.scale(this.zoom, this.zoom); this.context.translate(this.canvas.width/2/this.zoom, this.canvas.height/2/this.zoom); @@ -38,7 +37,7 @@ asciiflow.View.prototype.drawState = function() { for (var i = 0; i < this.state.cells.length; i++) { for (var j = 0; j < this.state.cells[i].length; j++) { if (this.state.cells[i][j].value != null) { - this.context.fillText(this.state.cells[i][j].value, i*15, j*15); + this.context.fillText(this.state.cells[i][j].value, i*15 - this.offsetX, j*15 - this.offsetY); } } }