fix: Repair blend mode stacking context in canvas and display mode in live preview

This commit is contained in:
2026-06-02 23:27:50 -05:00
parent c90628efdf
commit cac5bd9faf
2 changed files with 4 additions and 5 deletions
@@ -222,6 +222,7 @@ export const BuilderCanvas: React.FC = () => {
// z-index from array position: index 0 = back, last = front // z-index from array position: index 0 = back, last = front
// Dragging/selected get temporary boost to stay on top during interaction // Dragging/selected get temporary boost to stay on top during interaction
zIndex: isDraggingField ? 1000 : isSelected ? 999 : idx + 1, zIndex: isDraggingField ? 1000 : isSelected ? 999 : idx + 1,
mixBlendMode: field.style.blendMode && field.style.blendMode !== 'normal' ? field.style.blendMode as any : undefined,
}} }}
> >
{/* Field box */} {/* Field box */}
@@ -367,10 +368,7 @@ const BrandVariableContent: React.FC<{ field: TemplateField; designMD: DesignMD;
src={designMD.logoUrl} src={designMD.logoUrl}
alt="Logo" alt="Logo"
className="max-w-full max-h-full object-contain pointer-events-none p-1" className="max-w-full max-h-full object-contain pointer-events-none p-1"
style={{ style={{ opacity: (field.style.opacity ?? 100) / 100 }}
opacity: (field.style.opacity ?? 100) / 100,
mixBlendMode: field.style.blendMode as any,
}}
/> />
); );
} }
@@ -391,7 +389,6 @@ const BrandVariableContent: React.FC<{ field: TemplateField; designMD: DesignMD;
objectFit: objectFit as any, objectFit: objectFit as any,
backgroundColor: objectFit === 'contain' ? (bgColor || 'transparent') : 'transparent', backgroundColor: objectFit === 'contain' ? (bgColor || 'transparent') : 'transparent',
opacity: (field.style.opacity ?? 100) / 100, opacity: (field.style.opacity ?? 100) / 100,
mixBlendMode: field.style.blendMode as any,
}} }}
muted muted
loop loop
+2
View File
@@ -356,6 +356,7 @@ export function compileExpressToTimeline(
blendMode: field.style.blendMode, blendMode: field.style.blendMode,
layerId, layerId,
isBrandElement: field.nature === 'brand-variable', isBrandElement: field.nature === 'brand-variable',
brandDisplayMode: 'overlay',
isLocked: field.nature === 'static', isLocked: field.nature === 'static',
elementName: field.label, elementName: field.label,
// Placeholder mode for empty media fields // Placeholder mode for empty media fields
@@ -429,6 +430,7 @@ export function compileExpressToTimeline(
opacity: field.style.opacity ?? 100, opacity: field.style.opacity ?? 100,
layerId, layerId,
isBrandElement: field.type === 'logo', isBrandElement: field.type === 'logo',
brandDisplayMode: 'overlay',
isLocked: false, isLocked: false,
elementName: field.label, elementName: field.label,
// Placeholder mode for empty media fields // Placeholder mode for empty media fields