mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Issue #772 - flash colorpicker cursor when using middle click or alt+click
This commit is contained in:
parent
f462cd3b70
commit
0e5d74e1d8
@ -345,6 +345,8 @@
|
|||||||
// Picking color after ALT+click or middle mouse button click.
|
// Picking color after ALT+click or middle mouse button click.
|
||||||
this.pickColorAt_(coords);
|
this.pickColorAt_(coords);
|
||||||
this.isPickingColor = false;
|
this.isPickingColor = false;
|
||||||
|
// Flash the cursor to briefly show the colorpicker cursor.
|
||||||
|
this.flashColorPicker_();
|
||||||
} else if (isMiddleDrag) {
|
} else if (isMiddleDrag) {
|
||||||
// Stop the drag handler after a middle button drag action.
|
// Stop the drag handler after a middle button drag action.
|
||||||
this.dragHandler.stopDrag();
|
this.dragHandler.stopDrag();
|
||||||
@ -380,6 +382,16 @@
|
|||||||
$.publish(evt, [color]);
|
$.publish(evt, [color]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ns.DrawingController.prototype.flashColorPicker_ = function () {
|
||||||
|
document.body.classList.add('tool-colorpicker');
|
||||||
|
document.body.classList.remove(this.currentToolBehavior.toolId);
|
||||||
|
window.clearTimeout(this.flashColorPickerTimer);
|
||||||
|
this.flashColorPickerTimer = window.setTimeout(function () {
|
||||||
|
document.body.classList.remove('tool-colorpicker');
|
||||||
|
document.body.classList.add(this.currentToolBehavior.toolId);
|
||||||
|
}.bind(this), 200);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translate absolute x,y screen coordinates into sprite coordinates
|
* Translate absolute x,y screen coordinates into sprite coordinates
|
||||||
* @param {Number} screenX
|
* @param {Number} screenX
|
||||||
|
Loading…
Reference in New Issue
Block a user