diff --git a/src/components/application-menu/application-menu.vue b/src/components/application-menu/application-menu.vue index 28fbeb4..fd378a6 100644 --- a/src/components/application-menu/application-menu.vue +++ b/src/components/application-menu/application-menu.vue @@ -394,7 +394,6 @@ import { CREATE_DOCUMENT, RESIZE_DOCUMENT, SAVE_DOCUMENT, EXPORT_IMAGE, LOAD_SELECTION, SAVE_SELECTION, PREFERENCES, RESIZE_CANVAS, GRID_TO_LAYERS, STROKE_SELECTION } from "@/definitions/modal-windows"; -import { getRectangleForSelection } from "@/math/selection-math"; import CloudServiceConnector from "@/mixins/cloud-service-connector"; import ImageToDocumentManager from "@/mixins/image-to-document-manager"; import { getCanvasInstance } from "@/factories/sprite-factory"; @@ -403,6 +402,7 @@ import LayerFactory from "@/factories/layer-factory"; import { supportsFullscreen, setToggleButton } from "@/utils/environment-util"; import { cloneCanvas } from "@/utils/canvas-util"; import { renderFullSize } from "@/utils/document-util"; +import { selectionToRectangle } from "@/utils/selection-util"; import sharedMessages from "@/messages.json"; // for CloudServiceConnector import messages from "./messages.json"; @@ -574,8 +574,8 @@ export default { width : this.activeDocument.width, height : this.activeDocument.height }; - const selection = [ ...this.activeDocument.selection ]; - const { left, top, width, height } = getRectangleForSelection( selection ); + const selection = [ ...this.activeDocument.activeSelection ]; + const { left, top, width, height } = selectionToRectangle( selection ); const commit = async () => { await store.commit( "cropActiveDocumentContent", { left, top }); store.commit( "setActiveDocumentSize", { diff --git a/src/components/selection-menu/load-selection/load-selection.vue b/src/components/selection-menu/load-selection/load-selection.vue index 4eb2ca4..162967d 100644 --- a/src/components/selection-menu/load-selection/load-selection.vue +++ b/src/components/selection-menu/load-selection/load-selection.vue @@ -1,7 +1,7 @@ /** * The MIT License (MIT) * - * Igor Zinken 2020-2022 - https://www.igorski.nl + * Igor Zinken 2020-2023 - https://www.igorski.nl * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in @@ -29,8 +29,9 @@
-
@@ -82,17 +83,24 @@ export default { return this.name.length > 0; }, }, + created() { + this.name = this.selections[ 0 ].value; + }, methods: { ...mapMutations([ "closeModal", "setActiveTool", ]), - requestLoad() { + async requestLoad() { if ( !this.isValid ) { return; } this.setActiveTool({ tool: ToolTypes.LASSO, document: this.activeDocument }); + + // allow interaction pane to spawn (if no select mode was active yet) + await this.$nextTick(); getCanvasInstance()?.interactionPane.setSelection( this.activeDocument.selections[ this.name ]); + this.closeModal(); }, }, diff --git a/src/components/selection-menu/save-selection/save-selection.vue b/src/components/selection-menu/save-selection/save-selection.vue index 26a7ebc..a9341b6 100644 --- a/src/components/selection-menu/save-selection/save-selection.vue +++ b/src/components/selection-menu/save-selection/save-selection.vue @@ -89,7 +89,7 @@ export default { if ( !this.isValid ) { return; } - this.saveSelection({ name: this.name, selection: this.activeDocument.selection }); + this.saveSelection({ name: this.name, selection: this.activeDocument.activeSelection }); this.closeModal(); }, }, diff --git a/src/components/stroke-selection-window/stroke-selection-window.vue b/src/components/stroke-selection-window/stroke-selection-window.vue index a21bf98..5e37a2f 100644 --- a/src/components/stroke-selection-window/stroke-selection-window.vue +++ b/src/components/stroke-selection-window/stroke-selection-window.vue @@ -112,7 +112,7 @@ export default { type : "stroke", size : this.size, color : this.color, - selection : this.activeDocument.selection + selection : this.activeDocument.activeSelection }); this.closeModal(); }, diff --git a/src/components/tool-options-panel/tool-options-selection/messages.json b/src/components/tool-options-panel/tool-options-selection/messages.json index a1beaef..125fb38 100644 --- a/src/components/tool-options-panel/tool-options-selection/messages.json +++ b/src/components/tool-options-panel/tool-options-selection/messages.json @@ -3,6 +3,7 @@ "selection": "Selection", "lockedRatio": "Locked ratio", "shiftKey": "Hold Shift while drawing selection", + "mergeDescr": "Hold shift prior to drawing a new selection to add to the existing selection.", "widthToHeight": "Width : height", "existingSelection": "Existing selection", "coordinates": "Coordinates", diff --git a/src/components/tool-options-panel/tool-options-selection/tool-options-selection.vue b/src/components/tool-options-panel/tool-options-selection/tool-options-selection.vue index 3d605d3..80912b5 100644 --- a/src/components/tool-options-panel/tool-options-selection/tool-options-selection.vue +++ b/src/components/tool-options-panel/tool-options-selection/tool-options-selection.vue @@ -1,7 +1,7 @@ /** * The MIT License (MIT) * - * Igor Zinken 2021-2022 - https://www.igorski.nl + * Igor Zinken 2021-2023 - https://www.igorski.nl * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in @@ -27,6 +27,7 @@ @focusout="handleBlur" >

+

-