File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -32,16 +32,17 @@ fn build_ui() -> impl Widget<AppState> {
32
32
)
33
33
. with_child (
34
34
AnimatedPadding :: new (
35
- Label :: new ( "Animated Padding" ) ,
35
+ // Seems setting the text width fixes the animation problem.
36
+ Label :: new ( "Animated Padding" ) . fix_width ( 200. ) ,
37
+ // Label::new("Animated Padding"),
36
38
|data : & AppState , _env| Insets :: uniform ( if data. add_space { 30.0 } else { 10.0 } ) ,
37
- ) . duration ( 2.0 ) . curve ( AnimationCurve :: EASE_IN_OUT )
38
-
39
+ ) . duration ( 0.3 ) . curve ( AnimationCurve :: EASE_IN_OUT )
39
40
)
40
41
. debug_paint_layout ( )
41
42
}
42
43
43
44
pub fn main ( ) {
44
- let main_window = WindowDesc :: new ( build_ui ( ) . center ( ) )
45
+ let main_window = WindowDesc :: new ( build_ui ( ) )
45
46
. title ( "Animated Padding Test" ) ;
46
47
47
48
let state = AppState {
You can’t perform that action at this time.
0 commit comments