mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
highlight target tool pixel - intial commit
This commit is contained in:
@ -8,6 +8,8 @@ var Constants = {
|
|||||||
* strokes and rectangles:
|
* strokes and rectangles:
|
||||||
*/
|
*/
|
||||||
SELECTION_TRANSPARENT_COLOR: 'rgba(255, 255, 255, 0.6)',
|
SELECTION_TRANSPARENT_COLOR: 'rgba(255, 255, 255, 0.6)',
|
||||||
|
|
||||||
|
TOOL_TARGET_HIGHLIGHT_COLOR: 'rgba(255, 255, 255, 0.2)',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default entry point for piskel web service:
|
* Default entry point for piskel web service:
|
||||||
|
@ -12,7 +12,24 @@
|
|||||||
|
|
||||||
ns.BaseTool.prototype.moveToolAt = function(col, row, color, frame, overlay) {};
|
ns.BaseTool.prototype.moveToolAt = function(col, row, color, frame, overlay) {};
|
||||||
|
|
||||||
ns.BaseTool.prototype.moveUnactiveToolAt = function(col, row, color, frame, overlay) {};
|
ns.BaseTool.prototype.moveUnactiveToolAt = function(col, row, color, frame, overlay) {
|
||||||
|
if (overlay.containsPixel(col, row)) {
|
||||||
|
if (this.previouslyHighlightedPixelCol &&
|
||||||
|
this.previouslyHighlightedPixelRow &&
|
||||||
|
(this.previouslyHighlightedPixelRow != row ||
|
||||||
|
this.previouslyHighlightedPixelCol != col)) {
|
||||||
|
|
||||||
|
// Clean the previously highlighted pixel:
|
||||||
|
overlay.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show the current pixel targeted by the tool:
|
||||||
|
overlay.setPixel(col, row, Constants.TOOL_TARGET_HIGHLIGHT_COLOR);
|
||||||
|
|
||||||
|
this.previouslyHighlightedPixelCol = col;
|
||||||
|
this.previouslyHighlightedPixelRow = row;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
ns.BaseTool.prototype.releaseToolAt = function(col, row, color, frame, overlay) {};
|
ns.BaseTool.prototype.releaseToolAt = function(col, row, color, frame, overlay) {};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user