From f2b1e433c0f4b96de1b501480b9cd7d7cae529ab Mon Sep 17 00:00:00 2001 From: juliandescottes Date: Thu, 6 Sep 2012 01:09:02 +0200 Subject: [PATCH] realigned cursros hotspots --- css/tools.css | 8 ++++---- js/piskel.js | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/css/tools.css b/css/tools.css index fed74a34..2c1a0ba6 100644 --- a/css/tools.css +++ b/css/tools.css @@ -49,19 +49,19 @@ }*/ .tool-paint-bucket .drawing-canvas-container:hover { - cursor: url(../img/tools/cursors/paint-bucket.png) 18 17, pointer; + cursor: url(../img/tools/cursors/paint-bucket.png) 14 12, pointer; } .tool-pen .drawing-canvas-container:hover { - cursor: url(../img/tools/cursors/pen.png) 7 21, pointer; + cursor: url(../img/tools/cursors/pen.png) 2 21, pointer; } .tool-eraser .drawing-canvas-container:hover { - cursor: url(../img/tools/cursors/eraser.png) 5 21, pointer; + cursor: url(../img/tools/cursors/eraser.png) 2 21, pointer; } .tool-stroke .drawing-canvas-container:hover { - cursor: url(../img/tools/cursors/pen.png) 5 21, pointer; + cursor: url(../img/tools/cursors/pen.png) 2 21, pointer; } .tool-rectangle .drawing-canvas-container:hover { diff --git a/js/piskel.js b/js/piskel.js index 2cad41ae..6ebef1bc 100644 --- a/js/piskel.js +++ b/js/piskel.js @@ -212,8 +212,9 @@ $.namespace("pskl"); var currentTime = new Date().getTime(); // Throttling of the mousemove event: if ((currentTime - previousMousemoveTime) > 40 ) { + var spriteCoordinate = this.getSpriteCoordinate(event); if (isClicked) { - var spriteCoordinate = this.getSpriteCoordinate(event); + currentToolBehavior.moveToolAt( spriteCoordinate.col, spriteCoordinate.row, @@ -225,6 +226,11 @@ $.namespace("pskl"); // Eg when drawing, it may make sense to have it here. However for a non drawing tool, // you don't need to draw anything when mousemoving and you request useless localStorage. $.publish(Events.LOCALSTORAGE_REQUEST); + } else { + // debug mode to see the selected pixel + // this.drawingController.clearOverlay(); + // this.drawingController.overlay.setPixel( spriteCoordinate.col,spriteCoordinate.row, "#ff0000"); + // this.drawingController.renderOverlay(); } previousMousemoveTime = currentTime; }