This topic is about 2 bugs that are closely tied to each other.
I’ll use the Translate transformation as an example.
#1: UI transitions can’t handle changes in units.
Transition animations will be ignored if there is a difference in units between the initial and transitioned states.
Example transitions ( runs transition animation, does not):
Default values => Length
=>
(Pixel, Pixel) => (Length, Length)
=>
Mirroring ONLY changing values
=>
Exact Mirroring
=>
or
=>
So why is this a problem? Once you’ve identified what you want to transition, it should be fine once you’ve matched the units, right? That brings us to the second bug.
#2 USS doesn’t save the unit of a zero-value attribute.
If an attribute has a value of zero, USS assumes it is empty/ignored and doesn’t bother saving the unit between runtimes.
So you can set Translate to 0% 0% in the UI Builder or directly in the USS.
In either case, it will be AUTOMATICALLY reset to 0px 0px in the UI Builder and 0 0 in uss when you reload your project.
Before Reload:
.translatable {
translate: 0% 0%;
}
After Reload:
.translatable {
translate: 0 0;
}
So Unless I write the transition in c# instead, I can’t use Length for transitions? Let me know if I’m mistaken or this gets patched.
Thanks in advance!