Bug Description
Trying to animate opacity on an object with zero size (height: 0px) breaks the opacity animation.
In the example below, the accordion children are expected to fade in while expanding. Instead they are invisible until the animation finishes.
Trying to animate the opacity from a non-zero value (e.g. 0.99 -> 1.0) also makes the component invisible.
This is reproducible in SlintPad.
Reproducible Code (if applicable)
import { AboutSlint, Button } from "std-widgets.slint";
component Accordion inherits VerticalLayout {
property <bool> expanded;
width: 90%;
Button {
text: "Accordion";
clicked => { expanded = !expanded; }
height: 80px;
}
Rectangle {
clip: true;
opacity: 0; // any value below 1 triggers the behavior
height: 0px; // 1px works as expected
states [
expanded when expanded: {
height: self.preferred-height;
opacity: 1;
in-out {
animate height, opacity {
duration: 0.5s;
}
}
}
]
@children
}
}
export component Demo {
width: 400px;
height: 520px;
VerticalLayout {
alignment: start;
Accordion {
Accordion {
Accordion {
AboutSlint {}
}
}
}
}
}
Environment Details
- Slint Version: 1.16.0
- Platform/OS: All
- Programming Language: N/A
- Backend/Renderer: femtovg
Product Impact
Not critical, just inconvenient to debug, and it means our animations will look worse.
Bug Description
Trying to animate
opacityon an object with zero size (height: 0px) breaks the opacity animation.In the example below, the accordion children are expected to fade in while expanding. Instead they are invisible until the animation finishes.
Trying to animate the opacity from a non-zero value (e.g.
0.99 -> 1.0) also makes the component invisible.This is reproducible in SlintPad.
Reproducible Code (if applicable)
Environment Details
Product Impact
Not critical, just inconvenient to debug, and it means our animations will look worse.