mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-21 20:52:12 -03:00
Refactor logging and formatting
Improved code readability
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user