[libadwaita/wip/exalm/squeezer-crossfade-fix] squeezer: Fix the crossfade transition




commit 965b39705cc776d06859b99498f220bc07d7cb15
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Apr 19 14:49:20 2021 +0500

    squeezer: Fix the crossfade transition
    
    We only need the extra transform if the last visible child is larger than
    the squeeezer.
    
    Fixes https://gitlab.gnome.org/GNOME/libadwaita/-/issues/15

 src/adw-squeezer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/adw-squeezer.c b/src/adw-squeezer.c
index 0869a9f..e0eaceb 100644
--- a/src/adw-squeezer.c
+++ b/src/adw-squeezer.c
@@ -779,8 +779,8 @@ adw_squeezer_snapshot_crossfade (GtkWidget   *widget,
   gtk_snapshot_push_cross_fade (snapshot, progress);
 
   if (self->last_visible_child) {
-    int width_diff = gtk_widget_get_width (widget) - self->last_visible_widget_width;
-    int height_diff = gtk_widget_get_height (widget) - self->last_visible_widget_height;
+    int width_diff = MIN (gtk_widget_get_width (widget) - self->last_visible_widget_width, 0);
+    int height_diff = MIN (gtk_widget_get_height (widget) - self->last_visible_widget_height, 0);
 
     gtk_snapshot_translate (snapshot,
                             &GRAPHENE_POINT_INIT (


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