Commit Graph

75 Commits

Author SHA1 Message Date
Dariusz L
acdd12b65e Add mask drawing tool and improve mask handling
Introduces a new MaskTool for interactive mask drawing with adjustable brush size, strength, and softness. Updates Canvas.js to integrate mask editing, rendering, and saving, including support for saving images with and without masks. Enhances the UI in Canvas_view.js with mask controls and a dialog for canvas resizing. Updates canvas_node.py to load images without masks for processing. These changes improve user control over mask creation and management in the canvas workflow.
2025-06-25 02:47:40 +02:00
Dariusz L
03ab254f63 Improve layer state comparison and mirror methods
Added getStateSignature to compare layer states by serializing relevant properties, avoiding issues with image object references. Refactored mirrorHorizontal and mirrorVertical to be async and await all image updates before rendering and saving state, ensuring consistency and preventing race conditions.
2025-06-24 19:42:28 +02:00
Dariusz L
0e590ab5d7 Fix aspect ratio lock when resizing with Shift key
Simplifies and corrects the logic for maintaining the original aspect ratio when resizing objects with the Shift key pressed. Ensures consistent behavior regardless of handle or direction.
2025-06-24 19:23:06 +02:00
Dariusz L
64550609b8 Add saveState calls after layer modifications
Added calls to saveState() after scaling, rotating, and removing layers to ensure changes are properly recorded in the undo/redo history. Also refactored the matting button UI for better layout and ensured saveState is called after matting results are applied.
2025-06-24 17:30:32 +02:00
Dariusz L
a874a341e0 Migrate canvas state storage to IndexedDB
Replaced localStorage usage in Canvas.js with asynchronous IndexedDB operations for saving, loading, and removing canvas state. Added a new db.js module to handle IndexedDB interactions, improving scalability and reliability of state persistence.
2025-06-24 08:21:34 +02:00
Dariusz L
e47d51e19c Add localStorage state persistence and refactor image loading
Introduces methods to save and load canvas state to localStorage, enabling persistence across sessions. Refactors image loading for drag-and-drop, file input, and clipboard paste to use FileReader and data:URL, improving compatibility and reliability. Updates layer addition to consistently update selection and save state. Calls loadInitialState on widget creation to restore previous state if available.
2025-06-24 08:11:45 +02:00
Dariusz L
c8e7e2c561 Add undo/redo functionality to Canvas
Implemented undo and redo history stacks in Canvas.js, including keyboard shortcuts (Ctrl+Z, Ctrl+Y/Shift+Z), and state saving on relevant actions. Added Undo and Redo buttons to the UI in Canvas_view.js, with dynamic enable/disable based on history state.
2025-06-24 05:34:32 +02:00
Dariusz L
181d9c89c7 Added focus on canvas 2025-06-21 03:01:49 +02:00
Dariusz L
c46054e442 Update Canvas.js 2025-06-21 02:01:20 +02:00
Dariusz L
797666e2a3 Transform in group 2025-06-21 00:43:07 +02:00
Dariusz L
d9ac5546dd Keep Proportion with shift 2025-06-21 00:25:09 +02:00
Dariusz L
8cd0716449 Move Canvas 2025-06-21 00:15:51 +02:00
Dariusz L
3e1e8bb372 Added Copy-Pasted 2025-06-21 00:00:29 +02:00
Dariusz L
62d858b0c4 Inteligent Scale 2025-06-20 23:42:46 +02:00
Dariusz L
4ab539eea0 Canvas always on top 2025-06-20 23:22:44 +02:00
Dariusz L
7b0400a187 Layer fix 2025-06-20 21:59:01 +02:00
Dariusz L
bea71e19e2 Buton disabled 2025-06-20 21:14:47 +02:00
Dariusz L
66e6e6586f Update Canvas.js
Show Layer
2025-06-20 20:24:40 +02:00
Dariusz L
0e45ad15d3 Update Canvas.js 2025-06-20 20:14:59 +02:00
Dariusz L
51c843f393 Update Canvas.js 2025-06-20 19:30:29 +02:00
Dariusz L
2ccc784745 Added Outpainting Logic 2025-06-20 19:04:49 +02:00
tanglup
f847a65f67 Add files via upload 2024-11-25 01:28:18 +00:00
tanglup
58b52ba659 Update Canvas.js 2024-11-24 10:31:41 +08:00
tanglup
160554bfcc Update Canvas.js 2024-11-20 18:19:48 +08:00
tanglup
87ab68d409 Add files via upload 2024-11-19 15:40:36 +00:00