Add layer flipH/flipV properties and rendering support

Refactors horizontal and vertical mirroring to toggle flipH/flipV properties on layers instead of modifying image data. Updates rendering logic in CanvasLayers and CanvasRenderer to apply horizontal/vertical flipping via canvas transforms. Adds flipH and flipV to Layer type and includes them in state signature calculation.
This commit is contained in:
Dariusz L
2025-07-21 22:35:18 +02:00
parent 674879b497
commit 57bd1e1499
7 changed files with 52 additions and 84 deletions

View File

@@ -111,7 +111,9 @@ export function getStateSignature(layers) {
rotation: Math.round((layer.rotation || 0) * 100) / 100,
zIndex: layer.zIndex,
blendMode: layer.blendMode || 'normal',
opacity: layer.opacity !== undefined ? Math.round(layer.opacity * 100) / 100 : 1
opacity: layer.opacity !== undefined ? Math.round(layer.opacity * 100) / 100 : 1,
flipH: !!layer.flipH,
flipV: !!layer.flipV
};
if (layer.imageId) {
sig.imageId = layer.imageId;