Commit Graph

177 Commits

Author SHA1 Message Date
Dariusz L
8efb9d91b0 Remove legacy delegating methods from Canvas.js
Removed all remaining delegating methods from Canvas.js, including handleMouseMove and garbage collection helpers, as part of finalizing the refactor to a pure facade. Updated REFACTORING_GUIDE.md to reflect the completion of this refactor and clarify the new architecture.
2025-06-29 20:43:02 +02:00
Dariusz L
0b3bdaf769 Remove CanvasLayers delegation methods from Canvas.js
Eliminated 14 delegation methods to CanvasLayers from Canvas.js. Updated all relevant calls in CanvasRenderer.js, CanvasIO.js, and CanvasInteractions.js to use canvas.canvasLayers directly. This streamlines the Canvas class to only expose core facade operations and necessary helpers.
2025-06-29 20:39:31 +02:00
Dariusz L
1bb4909438 Remove CanvasState delegating methods from Canvas
Removed delegating methods to CanvasState from Canvas.js and updated all references to use canvas.canvasState directly for state operations (undo, redo, saveStateToDB). Updated CanvasInteractions.js, CanvasIO.js, CanvasLayers.js, and CanvasView.js accordingly. Updated REFACTORING_GUIDE.md to reflect the completion of this refactor.
2025-06-29 14:11:34 +02:00
Dariusz L
fd611c5777 Refactor CanvasLayers to use consistent canvas reference
Renamed the CanvasLayers constructor parameter from 'canvasLayers' to 'canvas' and updated all internal references accordingly for clarity and consistency. Adjusted CanvasView.js to call layer operations via canvas.canvasLayers. Updated REFACTORING_GUIDE.md to document these architectural changes and ensure all modules follow a unified naming convention.
2025-06-29 13:57:53 +02:00
Dariusz L
22627b7532 Delegate layer resize and rotate to CanvasLayers
Moved the resizeLayer and rotateLayer logic from Canvas.js to CanvasLayers.js, improving modularity and consistency. Updated REFACTORING_GUIDE.md to reflect these changes and document the current architecture and status.
2025-06-29 13:47:08 +02:00
Dariusz L
b4a662b036 Refactor CanvasView.js to use new Canvas facade modules
Updated all CanvasView.js method calls to use the new modular structure (canvasIO, canvasLayers, imageReferenceManager) as part of the Canvas facade refactor. Updated REFACTORING_GUIDE.md to reflect completed migration, document new usage patterns, and outline next steps. This improves code clarity and modularity while maintaining backward compatibility.
2025-06-29 13:42:52 +02:00
Dariusz L
d50a0443c3 Set default log level to DEBUG and add refactoring guide
Changed the default log level from NONE to DEBUG in both canvas_node.py and LoggerUtils.js to improve logging visibility during development. Added js/REFACTORING_GUIDE.md with detailed documentation on the recent Canvas module refactor, outlining architectural changes, migration instructions, and developer notes.
2025-06-29 04:44:08 +02:00
Dariusz L
9dcf38b36d Refactor Canvas class as facade and clean up CanvasLayers
Refactored the Canvas class to act as a facade, providing a simplified high-level interface and delegating detailed operations to internal modules. Added Polish documentation, grouped and clarified main operations, and moved legacy/delegation methods to the end for backward compatibility. Removed unused or redundant methods from CanvasLayers.js, such as removeLayer, moveLayer, addMattedLayer, isRotationHandle, getResizeHandle, handleBlendModeSelection, and getFlattenedCanvasAsDataURL, to streamline the codebase.
2025-06-29 04:41:48 +02:00
Dariusz L
7a7c8f2295 Add mask editor integration to canvas workflow
Introduces the ability to open the current canvas in a mask editor, upload and retrieve mask edits, and apply them to the mask layer. Adds utility functions for mask editor state detection and control, a new 'Edit Mask' button in the UI, and methods for handling mask updates and preview refresh. Also adds a setMask method to MaskTool for precise mask placement.
2025-06-29 04:15:45 +02:00
Dariusz L
fc8ebedb1e Update README.md 2025-06-29 00:47:53 +02:00
GitHub Action
98037324cd create clone count badge 2025-06-28 22:35:15 +00:00
Dariusz L
372a7a4718 Update clone.yml 2025-06-29 00:28:22 +02:00
Dariusz L
8a18e4ec30 Update clone.yml 2025-06-29 00:24:49 +02:00
Dariusz L
ade3cd7818 Add GitHub clone count badge workflow
Introduces a GitHub Actions workflow to update and display the repository's clone count using a dynamic badge. Updates README.md to include the clone count badge.
2025-06-29 00:22:15 +02:00
Dariusz L
4a9dc3219b Update release.yml 2025-06-29 00:06:47 +02:00
Dariusz L
5e7b6778c0 Add GitHub Actions workflow for automated releases
Introduces a release workflow that triggers on pushes to main. The workflow extracts the version from pyproject.toml, ensures unique version tags, and creates a GitHub release using softprops/action-gh-release.
v1.2.4
2025-06-29 00:04:49 +02:00
Dariusz L
a2d133f4fe Update README.md 2025-06-28 23:46:54 +02:00
Dariusz L
3a8bca593c Update README.md 2025-06-28 23:34:16 +02:00
Dariusz L
bcb4153ddc Update README.md 2025-06-28 23:23:36 +02:00
Dariusz L
2ed6b9ea1a Update README.md 2025-06-28 23:22:23 +02:00
Dariusz L
8f5298cb69 Update README.md 2025-06-28 23:18:15 +02:00
Dariusz L
e088e6a04e Update README.md 2025-06-28 22:51:54 +02:00
Dariusz L
cf52b99ba6 Update README.md 2025-06-28 22:48:24 +02:00
Dariusz L
fc5e856a09 Update README.md 2025-06-28 22:20:30 +02:00
Dariusz L
38c81fe498 Bump version to 1.2.4
Update the project version in pyproject.toml from 1.2.3 to 1.2.4.
2025-06-28 20:26:04 +02:00
Dariusz L
f6a491e83b Adjust text background height and padding in CanvasRenderer
Refines the calculation of text background height and vertical padding for multi-line text rendering, ensuring more consistent spacing and alignment.
2025-06-28 19:56:13 +02:00
Dariusz L
7a52be5a79 Show original image size in layer info overlay
Added originalWidth and originalHeight properties to layers in CanvasLayers.js. Updated CanvasRenderer.js to display the original image dimensions in the layer info overlay if available, and improved overlay rendering to support multiline text.
2025-06-28 19:54:34 +02:00
Dariusz L
4376a21147 Add 'fit on add' option for image placement
Introduces a 'fit_on_add' boolean option to control whether images are fit to the canvas when added or pasted. Updates image addition and paste logic in Canvas, CanvasLayers, and CanvasView to support new placement modes ('fit', 'center', 'mouse', 'default').
2025-06-28 19:48:57 +02:00
Dariusz L
8ead4176b5 Add paste mode to handlePaste for image positioning
The handlePaste method now accepts a pasteMode parameter to control image placement, allowing images to be pasted either at the mouse position or centered on the canvas. This improves user control when pasting images via keyboard shortcuts or UI buttons.
2025-06-28 19:30:24 +02:00
Dariusz L
aee5836252 Bump version to 1.2.3
Incremented the project version in pyproject.toml from 1.2.2 to 1.2.3.
2025-06-28 09:47:06 +02:00
Dariusz L
81b2a9cc4e Remove redundant white background fill in CanvasIO
Eliminated unnecessary code that filled temporary canvases with a white background in two methods. This streamlines canvas creation and avoids redundant operations.
2025-06-28 09:44:43 +02:00
Dariusz L
eb262376fc Update pyproject.toml 2025-06-28 08:43:20 +02:00
Dariusz L
ffe37ea2fb Update pyproject.toml 2025-06-28 08:38:35 +02:00
Dariusz L
2033ab168a Set default log level to NONE and remove logger docs
Changed the default log level for both Python and JavaScript module loggers from DEBUG to NONE to disable logging by default. Removed the README_LOGGER.md documentation file, and updated README.md to remove a reference to seamless integration.
2025-06-28 08:38:08 +02:00
Dariusz L
7682b362ed Merge branch 'main' of https://github.com/Azornes/Comfyui-LayerForge 2025-06-28 08:34:49 +02:00
Dariusz L
d37c4a5077 Delete ShowTimeLayerForge.gif 2025-06-28 08:34:36 +02:00
Dariusz L
bde9e7a0e4 Update README.md 2025-06-28 08:32:38 +02:00
Dariusz L
f15c804bbc Update README.md 2025-06-28 08:28:14 +02:00
Dariusz L
32a8512c9c Update README.md 2025-06-28 08:25:11 +02:00
Dariusz L
5b740e5982 Add ShowTimeLayerForge.gif and update README path
Added the ShowTimeLayerForge.gif file to the Media directory and updated the README to reference the new path for the GIF.
2025-06-28 08:24:37 +02:00
Dariusz L
981bf72513 Update video reference and remove old .webm file
Replaced the .webm video reference in README.md with a .gif version and deleted the obsolete ShowTimeLayerForge.webm file.
2025-06-28 08:22:40 +02:00
Dariusz L
e3d959f048 Update README.md 2025-06-28 08:19:17 +02:00
Dariusz L
f6d29de651 Add ShowTimeLayerForge.webm video asset
Introduces a new video file, ShowTimeLayerForge.webm, to the Showtime directory. This asset may be used for media playback or demonstration purposes within the project.
2025-06-28 08:17:55 +02:00
Dariusz L
7c3a6f72c7 Defer canvas rendering with setTimeout for UI updates
Replaces direct calls to canvas.render() and node.onResize() with setTimeout to defer execution, ensuring UI updates occur after DOM changes. This helps prevent rendering issues and improves responsiveness when toggling mask controls and editor view.
2025-06-28 08:07:10 +02:00
Dariusz L
51eaac362a Rename brush softness to hardness in mask tool
Replaces all references to 'softness' with 'hardness' for brush controls in both CanvasView.js and MaskTool.js. Updates UI labels, slider IDs, and internal logic to use 'hardness' terminology, clarifying that a higher value means a harder brush edge.
2025-06-28 07:59:32 +02:00
Dariusz L
a1e00ca06a Add brush preview overlay to MaskTool
Introduces a brush preview overlay using a separate preview canvas in MaskTool. Mouse event handlers in CanvasInteractions and MaskTool are updated to support passing both world and view coordinates, enabling accurate brush preview rendering. The preview is shown or hidden appropriately on mouse enter/leave and while drawing.
2025-06-28 07:37:53 +02:00
Dariusz L
940f027b40 Increase logging level to DEBUG and enhance MaskTool callbacks
Set logging level to DEBUG in both Python and JavaScript loggers for improved debugging. Updated MaskTool to accept an onStateChange callback and trigger it after mask state changes, allowing Canvas to respond to mask updates.
2025-06-28 07:28:58 +02:00
Dariusz L
a7208cb504 Update README.md 2025-06-28 06:50:32 +02:00
Dariusz L
f08214e224 Bump version to 1.2.1 in pyproject.toml
Updated the project version from 1.2.0 to 1.2.1 in preparation for a new release.
2025-06-28 06:11:37 +02:00
Dariusz L
0078faf1fd Set default log level to NONE and improve logger checks
Changed the default log level to LogLevel.NONE in both Python and JavaScript logger utilities. Updated LayerForgeLogger to fully disable logging when the effective level is NONE, ensuring no logs are emitted for disabled modules.
2025-06-28 06:11:12 +02:00