slint
slint copied to clipboard
`opacity` messes up with the x and y property
As seen in this example: We would like the text to say "I'm at 100,50", and the change of parent.x should animate and and the rectangle should go left, not right.
Hello := Rectangle {
x: 100px;
background: blue;
Text { text: "I'm at \{root.x/1px},\{root.y/1px}"; }
}
export Demo := Window {
width: 300px; height: 300px;
background: gray;
Hello {
opacity: 0.5;
animate x { duration: 2s; }
y: 50px;
TouchArea { clicked => { parent.x = 50px; } }
}
}
That's because adjust_geometry_for_injected_parent
used by the opacity pass moves the x and y binding to the created Opacity element, but all the bindings to existing property are kept around.
depends on #1932