From: Robert Kaiser Date: Sun, 27 Jan 2013 20:07:01 +0000 (+0100) Subject: add an if to make it possible to turn off the optimized path for debugging X-Git-Tag: legacy-preGL~31 X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=747bbd5502fa727b93d5e7c3d68d3e33ea089ef3;p=lantea.git add an if to make it possible to turn off the optimized path for debugging --- 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;