MCM: bind elements[1].fill.paint (not elements[0])

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
igurielidze 2026-04-01 19:35:00 +04:00
parent 0ace92e15d
commit cdd8d7da42

View File

@ -326,9 +326,14 @@ function generateElementBindings(elements: SvgElement[]): Record<string, any> {
if (el.elements.length > 1 && el.elements[1].elements && el.elements[1].elements.length > 1) {
propConfig[`${prefix}.elements[1].elements[1].fill.paint`] = fillPaintBinding(n);
}
} else if (isDpm || isMcm) {
// DPM/MCM: only elements[0].fill.paint gets color binding
} else if (isDpm) {
// DPM: elements[0].fill.paint gets color binding
propConfig[`${prefix}.elements[0].fill.paint`] = fillPaintBinding(n);
} else if (isMcm) {
// MCM: elements[1].fill.paint gets color binding
if (el.elements.length > 1) {
propConfig[`${prefix}.elements[1].fill.paint`] = fillPaintBinding(n);
}
} else if (isButton) {
// Buttons: NO fill binding on elements[0] (background rect keeps static color)
// Only text elements get contrast color binding