Refactor logging and formatting

Improved code readability
This commit is contained in:
Dariusz L
2025-06-27 05:32:11 +02:00
parent be4fae2964
commit 83ce890ef4
16 changed files with 241 additions and 363 deletions

View File

@@ -128,7 +128,7 @@ export function getStateSignature(layers) {
return JSON.stringify(layers.map((layer, index) => {
const sig = {
index: index,
x: Math.round(layer.x * 100) / 100, // Round to avoid floating point precision issues
x: Math.round(layer.x * 100) / 100,
y: Math.round(layer.y * 100) / 100,
width: Math.round(layer.width * 100) / 100,
height: Math.round(layer.height * 100) / 100,
@@ -137,15 +137,11 @@ export function getStateSignature(layers) {
blendMode: layer.blendMode || 'normal',
opacity: layer.opacity !== undefined ? Math.round(layer.opacity * 100) / 100 : 1
};
// Include imageId if available
if (layer.imageId) {
sig.imageId = layer.imageId;
}
// Include image src as fallback identifier
if (layer.image && layer.image.src) {
sig.imageSrc = layer.image.src.substring(0, 100); // First 100 chars to avoid huge signatures
sig.imageSrc = layer.image.src.substring(0, 100);
}
return sig;