[libhandy] stackable-box: Don't use last visible child's size when it's NULL



commit babc0261b5202839c62f6daf57d43aa8b7608cb7
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Sep 22 03:45:41 2020 +0500

    stackable-box: Don't use last visible child's size when it's NULL
    
    When interpolate-size is true, we interpolate between the sizes of the
    current visible child and last visible child. This works assuming that the
    last visible child exists. However, before we switch visible child the
    first time, it doesn't, so we get 0 size and interpolate between that and
    the actual size.
    
    Instead, use regular visible child size if last visible child is null.
    
    Signed-off-by: Alexander Mikhaylenko <alexm gnome org>

 src/hdy-stackable-box.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/hdy-stackable-box.c b/src/hdy-stackable-box.c
index 4eb8fa38..417b3954 100644
--- a/src/hdy-stackable-box.c
+++ b/src/hdy-stackable-box.c
@@ -1396,6 +1396,8 @@ hdy_stackable_box_measure (HdyStackableBox *self,
     else
       get_preferred_size_for_size (self->last_visible_child->widget, for_size,
                                    &last_visible_min, NULL);
+  } else {
+    last_visible_min = visible_min;
   }
 
   visible_child_progress = self->child_transition.interpolate_size ? self->child_transition.progress : 1.0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]