[libadwaita/wip/exalm/squeezer-crossfade-fix: 3/3] squeezer: Fix the crossfade transition
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/squeezer-crossfade-fix: 3/3] squeezer: Fix the crossfade transition
- Date: Mon, 19 Apr 2021 09:51:56 +0000 (UTC)
commit 20419814704c2a25c994c0cfc19bc6b7b721f21b
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]