85 Commits

Author SHA1 Message Date
Igor Zinken
6584c86633 Add feather and threshold control to smart fill tool 2026-04-26 11:46:29 +02:00
Igor Zinken
b205a553d9 Restructure document model, factories and actions (#93)
Split `definitions/document.ts` into unique files per actor type.
Create `model` folder to store the above types, their factories and the state changing actions.
2026-04-19 20:34:06 +02:00
Igor Zinken
6eeed8c2bd Add support for unique state history per Document (#88)
Long overdue.

State history would only work for the active Document. When opening a new Document (without closing the existing one), the state history would be flushed and initiated anew for every change made in the currently focused Document.

This changeset introduces a state history unique to the Document, meaning you can switch between open Documents and maintain the history associated with your changes.
2026-04-11 12:30:57 +02:00
Igor Zinken
6baaaff871 Allow copy/cut/paste operations on multiple selected Layers (#87)
Simple copy/cut/paste operations were not supported for selected Layers. Further more, only a single selected Layer at a time was supported.

We now support multi select using shift + click. Copy pasting content now also works across timeline tiles for easier editing.
2026-04-08 21:39:20 +02:00
Igor Zinken
f085e19716 Add support for custom swatches 2026-04-04 12:36:47 +02:00
Igor Zinken
40b66bb21f Rebuild all thumbnails when toggling the thumbnail display on 2026-03-28 15:07:14 +01:00
Igor Zinken
1712ba2068 Shuffling layer order now triggers a tile re-render 2026-03-27 19:21:04 +01:00
Igor Zinken
3999c018e9 Unified crisp pixel rendering across rendering pipelines 2026-03-27 18:12:28 +01:00
Igor Zinken
baa00dc644 Add timeline mode for animation support (#83)
### Motivation

In order to be more useful as a spritesheet editor, BitMappery now contains a timeline view, a mode where content can be sub grouped into tiles, where each subsequent tile can be traced over the previous one. Each tile can have multiple layers of content for ease of editing.

### Changes

 * Introduced Document types `default` and `timeline`
 * Introduced LayerRef types (allow grouping Layers)
 * Introduced Timeline view for tile based drawing and tracing
 * Introduced Document background color (omits need to create background layer for each tile in a timeline)
 * Cleaned up some legacy overrides made superfluous by newer dependencies
 * Added document presets to document creation flow

### Commits

* Add rel to Layer structure
* Add Document type
* Initial scaffold for timeline view.
* Added initial utility to manage timelines
* Added action to clone all Layers in a tile group
* Moved Layer cloning to layer-util
* Converted zoom tool option panel to TypeScript
* Added action to add a new tile and layer to the Document
* Added action to remove a tile and its layers from the Document
* Added Layer grouping property to Document structure
* Update type check for test
* Initial timeline panel outline
* Created tiles now match Document dimensions
* Added tile cache
* Allow showing a semi transparent carbon copy trace of the previous tile
* Add animation preview window
* Add fps control to animation preview
* Store metadata property inside Documents (allows storing timeline framerate)
* Optimise mobile view for timeline
* Keep thumbnail ratios when previewing tiles and animations
* Button and animation preview window styling
* use RAF-based animation timing in animation preview
* Changes made to layer content now trigger a re-render of the Group tile
* Update Layer reordering logic to also work with subsets
* Optimised animated GIF export, updated pixel art definitions to be more sensible
* Code cleanups
* Added background color to Documents, omitting the need for a background layer on each animation tile
* Removing temp code, updating renderer factory test
* Update layer styling, added tooltip on drag behaviour
* Added document DPI and size unit to meta data
* Refactored deprecated event property from modal key handler
* Remove unused properties from animation preview window
* Update unit test for renderer factory
* Fix bug where closing modals would trigger click on canvas
* Add presets for all Document types
* Added setting to automatically choose appropriate anti-alias setting
* Invalidate tile and thumbnail caches on resize and crop functions. Adjust spritesheet export behaviour
2026-03-26 18:47:05 +01:00
Igor Zinken
712c7abd71 Add layer preview thumbnails to layers panel (#84)
### Motivation

It'd be great if we could see a small thumbnail preview in the layers panel to more easily distinguish between layers visually.

In this changeset we introduce the thumbnail cache. When enabled, each layer is represented by a thumbnail which can be requested from multiple subscribed consumers (currently only the layer panel).

Thumbnail updates are deferred to keep CPU usage low and performance high.
2026-03-21 14:57:28 +01:00
Igor Zinken
2a29dd6546 Split menu into separate reusable sections, introduced context menu actions to layer panel. Renamed tool-module to editor-module 2025-04-12 11:52:52 +02:00
Igor Zinken
d64ec1ae3e Refactor Layer effects and introduce duotone filter (#64)
* Added Duotone filter to effects
* Renamed Effects actor to Transform
2025-04-04 20:55:34 +02:00
Igor Zinken
00e0b7549a Allow committing effects and filters to a Layer source, control zoom level using pointer, move state changing actions to separate files. (#63)
* Implemented new commit layer effects and transforms action
* Moved all actions out of the application menu component
* Grid to layer slicing moved out of component
* Unified all layer filter toggling into single action
* Moved all layer panel history interactions to separate action files
* Moved mirror, rotation, later addition and document resize state actions to separate files
* Adjust behaviour of layer addition action
* Moved canvas resizing history action to separate file
* Move interaction pane selection logic into separate files
* Move layer positioning utilities to separate actions
* Use correct event variable in ZoomableCanvas
* Zoom tool now responds to clicks and alt+clicks when zoom is selected
2025-04-02 19:21:28 +02:00
Igor Zinken
94cd300259 When reordering or deleting Layers in a Document using blend caching, the cache should be flushed 2025-03-25 21:52:06 +01:00
Igor Zinken
d4dac30a6c Document resize can now be undone in state history. Document crop now cuts pixels of source content 2025-03-23 11:26:55 +01:00
Igor Zinken
630ba35b40 Restructure and rename actor/renderers (#57)
* Restructure and rename actor/renderers
* Rename cache flushing functions to reflect their scope
* Move canvas instance management to dedicated service
* Type resize-canvas-window Vue file
2025-03-16 11:32:42 +01:00
Igor Zinken
5b79291faf Moving some functions out of class instances to more logical utilities 2025-03-16 07:18:18 +01:00
Igor Zinken
83d8e7af4d Address issue where drawing operations on offset, cropped Layers would not use correct coordinate space 2025-03-15 10:19:27 +01:00
Igor Zinken
9d2e89bde1 Create blended layer cache minimising rendering overhead on Documents with blended content (#55)
* Create cache for blended layers to speed up rendering on Documents with blended content
* Manage blend mode caching state through layer changes in Document canvas
* Comments updated
* Moving files around
* Omit invisible layers in snapshot rendering
* Add pausing to blend layer cache
* Cleanups and tests for LayerSprite
* Remove logs
* Use actual LayerSprite in test
* Simplify pending check
* Omit flush calls on (un)pausing of cache
* Extend tests for LayerSprite
* Update modifier key tooltip
* Create reusable function for invalidating blend cache
* Updated tests
* Allow partial cache flushes
* Ensure blended layer cache is flushed appropriately on undo
* Pause blend caching while rotating or scaling
* Fix for Safari rendering issues
2025-03-14 22:54:25 +01:00
Igor Zinken
3e3570021f Add strict type checks to unit tests (#48)
* Add strict type checks to unit tests
2025-02-15 14:14:48 +01:00
Igor Zinken
fd3d1642f5 Fixed bug where slicing a grid to layers would calculate the wrong size and could potentially crash due to memory exhaustion 2025-02-08 11:49:02 +01:00
Igor Zinken
622d13825c Migrate project to Vue 3 (#42)
* Initial update of dependencies
* Fix ToggleButton import
* Prepare i18n and vitest
* Replace deprecated Vue set/delete syntax
* Fix async component loading, address errors caught by failing unit tests
* Fix type errors
* Fix bug with layer panel
* Fixed unit tests
* Fixed cloud file selectors
* Fixed broken notifications
* Fixed broken color picker
* Fix TypeScript configuration files
* Fixed unit test runner configuration
* Fixed type errors in cloud file selector
* Restored broken tooltips
* Show error message on import failure. Ignore Photoshop layers that fail to import
* Solved issues with deprecated Vue 2 syntax
* Fixed bug with compressing documents
* Fix layer refresh
2025-02-08 10:27:48 +01:00
Igor Zinken
d2b581d2ee Active selections now support multiple non-overlapping shapes
* Renamed Selection data structure. Multiple select begins to work
* Saving and loading of multiple selection shapes implemented
* Renamed Document selection properties to avoid confusion
* Renamed and distributed functions between selection and shape utilities
* Fixes to selection toolbox
* Fixed issue with copying across multiple selections
* Final cleanups
2023-03-31 22:10:41 +02:00
Igor Zinken
ee6dd0b556 Migrated all unit tests to TypeScript 2023-03-23 21:24:56 +01:00
Igor Zinken
8adb358b3b Initial migration from JavaScript to TypeScript 2023-03-20 22:45:49 +01:00
Igor Zinken
1f74f36eed Migrate build from Webpack to Vite 2023-03-19 11:49:18 +01:00
Igor Zinken
4159398352 Implement magic wand tool to select areas by color (#20) 2023-03-12 09:21:35 +01:00
Igor Zinken
a9c8243a48 Fixed regression with document resize 2022-02-13 11:16:59 +01:00
Igor Zinken
e57bc163ac Improve performance by moving transform effects from pre-cache to live rendering
* Selection outline is now rendered by interaction pane, not individual layer sprites
* Updated to zCanvas 4.3.1 to fix issue with bounding box detection on rotated content
* Refactored rectangles to always use left and top
* Layer scaling, rotating and mirroring is now a fast, synchronous operation
* Snapshots are now always of rendered layer content
2022-02-13 09:37:45 +01:00
Igor Zinken
71cad8512a Support wider zoom out scale (allows accurate "Fit to Window" calculation on large screens) 2022-02-06 18:05:50 +01:00
Igor Zinken
b41e0cc967 Updated unit test to match changes in implementation 2022-01-31 10:40:04 +01:00
Igor Zinken
22059511c8 Implemented smart fill 2022-01-31 09:44:17 +01:00
Igor Zinken
e688fd42be Added 'Fit to window' option to zoom tool 2022-01-22 22:44:10 +01:00
Igor Zinken
02d4690380 Selections can now be repositioned and resized in the tool panel for added accuracy 2022-01-21 15:01:55 +01:00
Igor Zinken
7631d61844 Added view control to toggle anti-aliasing 2022-01-21 08:09:00 +01:00
Igor Zinken
1c66d77123 Implemented guidelines and snap functionality 2021-09-11 19:48:08 +02:00
Igor Zinken
bda8eb99de Zoomed layers are not drawable until the zoom has been made permanent 2021-04-24 09:32:34 +02:00
Igor Zinken
886bc38315 Implemented locked ratio rectangle selection 2021-02-03 18:12:14 +01:00
Igor Zinken
037f117821 Resolved issues with layer history addressing bugs with layer reordering and Layer source drawable history 2021-01-20 21:33:47 +01:00
Igor Zinken
7d42360249 Added Image usage counter to Vuex image module, resolved memory leak in Dropbox image preview component 2021-01-20 19:49:32 +01:00
Igor Zinken
2fad55d935 Created singular entry points for Blob URL creation/revoking 2021-01-20 18:59:26 +01:00
Igor Zinken
694198b30f Fixed issues that occur with interaction pane on document switch 2021-01-19 16:25:01 +01:00
Igor Zinken
711abce3e6 Updated unit test 2021-01-19 12:24:45 +01:00
Igor Zinken
3997faf9bc Layer order swap is now also stored in state history 2021-01-19 11:57:00 +01:00
Igor Zinken
1af4e4e8b7 Implemented Layer sorting 2021-01-19 09:59:08 +01:00
Igor Zinken
b7720db1c3 Implemented preferences panel and low memory mode to reduce memory allocated by paint history 2021-01-18 13:28:19 +01:00
Igor Zinken
028c8c8093 Made brush undo states Blob based to overcome Safari Canvas allocation limit, added Vuex module based memory management for these state resources 2021-01-17 14:47:16 +01:00
Igor Zinken
3d343c63f4 Added layer interaction to state history 2021-01-12 17:15:24 +01:00
Igor Zinken
060e3abea0 Selections are now also stored in state history 2021-01-12 11:28:22 +01:00
Igor Zinken
85b70c12f9 Implemented state history mechanism (still hidden from UI as features need to be hooked up) 2021-01-11 21:45:59 +01:00