[libhandy/libhandy-1-0] carousel-box: Invalidate cache for children size allocate



commit 76a6e3312a88d9487bba6e64d34f6a9cfeac297d
Author: Marius Meisenzahl <mariusmeisenzahl gmail com>
Date:   Mon Dec 14 16:32:31 2020 +0000

    carousel-box: Invalidate cache for children size allocate

 src/hdy-carousel-box.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/hdy-carousel-box.c b/src/hdy-carousel-box.c
index a0bc4cf1..af4dbd20 100644
--- a/src/hdy-carousel-box.c
+++ b/src/hdy-carousel-box.c
@@ -821,6 +821,7 @@ hdy_carousel_box_size_allocate (GtkWidget     *widget,
 {
   HdyCarouselBox *self = HDY_CAROUSEL_BOX (widget);
   gint size, width, height;
+  gboolean should_invalidate = FALSE;
   GList *children;
 
   gtk_widget_set_allocation (widget, allocation);
@@ -865,11 +866,14 @@ hdy_carousel_box_size_allocate (GtkWidget     *widget,
   }
 
   if (width != self->child_width || height != self->child_height)
-    invalidate_drawing_cache (self);
+    should_invalidate = TRUE;
 
   self->child_width = width;
   self->child_height = height;
 
+  if (should_invalidate)
+    invalidate_drawing_cache (self);
+
   for (children = self->children; children; children = children->next) {
     HdyCarouselBoxChildInfo *child_info = children->data;
 


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