diff --git a/src/main.js b/src/main.js index 116ddae..7a101b5 100644 --- a/src/main.js +++ b/src/main.js @@ -104,11 +104,29 @@ let tools = { }, rectangle: { icon: "/assets/rectangle.svg", - properties: {} + properties: { + "lineWidth": { + type: "number", + label: "Line Width" + }, + "fillShape": { + type: "boolean", + label: "Fill Shape" + } + } }, ellipse: { icon: "assets/ellipse.svg", - properties: {} + properties: { + "lineWidth": { + type: "number", + label: "Line Width" + }, + "fillShape": { + type: "boolean", + label: "Fill Shape" + } + } }, paint_bucket: { icon: "/assets/paint_bucket.svg", @@ -165,6 +183,7 @@ let config = { copy: "c", paste: "v", delete: "Backspace", + selectAll: "a", group: "g", zoomIn: "+", zoomOut: "-", @@ -2112,6 +2131,10 @@ window.addEventListener("keydown", (e) => { case config.shortcuts.delete: delete_action() break; + case config.shortcuts.selectAll: + selectAll() + e.preventDefault() + break; case config.shortcuts.group: actions.group.create() break; @@ -2447,6 +2470,21 @@ function delete_action() { updateUI() } +function selectAll() { + context.selection = [] + context.shapeselection = [] + for (let child of context.activeObject.activeLayer.children) { + let idx = child.idx + if (idx in context.activeObject.currentFrame.keys) { + context.selection.push(child) + } + } + for (let shape of context.activeObject.currentFrame.shapes) { + context.shapeselection.push(shape) + } + updateUI() +} + function addFrame() { if (context.activeObject.currentFrameNum >= context.activeObject.activeLayer.frames.length) { actions.addFrame.create() @@ -3980,6 +4018,11 @@ async function updateMenu() { enabled: (context.selection.length > 0 || context.shapeselection.length > 0), action: delete_action }, + { + text: "Select All", + enabled: true, + action: selectAll + }, ] });