mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Fixed bugs in new selection system
This commit is contained in:
@ -30,6 +30,9 @@ const ToolManager = (() => {
|
||||
Events.on("mousedown", window, onMouseDown);
|
||||
Events.on("wheel", window, onMouseWheel);
|
||||
|
||||
// Assign a selection tool to the move tool
|
||||
tools["moveselection"].selectionTool = tools["lassoselect"];
|
||||
|
||||
// Bind tool shortcuts
|
||||
Events.onCustom("tool-shortcut", onShortcut);
|
||||
|
||||
@ -145,10 +148,13 @@ const ToolManager = (() => {
|
||||
return currTool;
|
||||
}
|
||||
|
||||
function switchTool(newTool) {
|
||||
function switchTool(newTool, event) {
|
||||
currTool.onDeselect();
|
||||
currTool = newTool;
|
||||
currTool.onSelect();
|
||||
|
||||
if (event != undefined)
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
return {
|
||||
|
Reference in New Issue
Block a user