mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Added back eraser tool
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
const ToolManager = (() => {
|
||||
brush = new BrushTool("brush", {type: 'html'});
|
||||
brush = new BrushTool("brush", {type: 'html'}, switchTool);
|
||||
eraser = new EraserTool("eraser", {type: 'html'}, switchTool);
|
||||
|
||||
currTool = brush;
|
||||
|
||||
Events.on("mouseup", window, onMouseUp);
|
||||
@ -63,6 +65,14 @@ const ToolManager = (() => {
|
||||
return currTool;
|
||||
}
|
||||
|
||||
function switchTool(newTool) {
|
||||
console.log("switch");
|
||||
|
||||
currTool.onDeselect();
|
||||
currTool = newTool;
|
||||
currTool.onSelect();
|
||||
}
|
||||
|
||||
return {
|
||||
currentTool
|
||||
}
|
||||
|
Reference in New Issue
Block a user