Fix DPM/MCM bindings: elements[0].fill.paint (not elements[1])
Matches Example pattern — first triangle path gets the color binding. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ba9b45a43e
commit
12a2ad62bf
@ -315,6 +315,7 @@ function generateElementBindings(elements: SvgElement[]): Record<string, any> {
|
||||
// Sub-element fill bindings — varies by device type
|
||||
const isButton = /_(?:JR|S|SS|EN)\d/i.test(elName);
|
||||
const isDpm = /_DPM\d*/i.test(elName);
|
||||
const isMcm = /^MCM\d*/i.test(elName);
|
||||
const isEpc = /_EPC\d*/i.test(elName);
|
||||
|
||||
if (el.elements && el.elements.length > 0) {
|
||||
@ -325,12 +326,9 @@ 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) {
|
||||
// DPM: only elements[1] gets color binding (the black triangle)
|
||||
// elements[0] stays as-is, elements[2] is transparent
|
||||
if (el.elements.length > 1) {
|
||||
propConfig[`${prefix}.elements[1].fill.paint`] = fillPaintBinding(n);
|
||||
}
|
||||
} else if (isDpm || isMcm) {
|
||||
// DPM/MCM: only elements[0].fill.paint gets color binding
|
||||
propConfig[`${prefix}.elements[0].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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user