From 747bbd5502fa727b93d5e7c3d68d3e33ea089ef3 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 27 Jan 2013 21:07:01 +0100 Subject: [PATCH] add an if to make it possible to turn off the optimized path for debugging --- js/map.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/js/map.js b/js/map.js index ec60e01..22307dc 100644 --- a/js/map.js +++ b/js/map.js @@ -459,13 +459,20 @@ var mapEvHandler = { var dY = y - gLastMouseY; gPos.x -= dX * gZoomFactor; gPos.y -= dY * gZoomFactor; - var mapData = gMapContext.getImageData(0, 0, gMapCanvas.width, gMapCanvas.height); - gMapContext.clearRect(0, 0, gMapCanvas.width, gMapCanvas.height); - gMapContext.putImageData(mapData, dX, dY); - drawMap({left: (dX > 0) ? dX : 0, - right: (dX < 0) ? -dX : 0, - top: (dY > 0) ? dY : 0, - bottom: (dY < 0) ? -dY : 0}); + if (true) { // use optimized path + var mapData = gMapContext.getImageData(0, 0, + gMapCanvas.width, + gMapCanvas.height); + gMapContext.clearRect(0, 0, gMapCanvas.width, gMapCanvas.height); + gMapContext.putImageData(mapData, dX, dY); + drawMap({left: (dX > 0) ? dX : 0, + right: (dX < 0) ? -dX : 0, + top: (dY > 0) ? dY : 0, + bottom: (dY < 0) ? -dY : 0}); + } + else { + drawMap(false, true); + } showUI(); } gLastMouseX = x; -- 2.43.0