[libadwaita/wip/exalm/squeezer-fix: 5/5] squeezer: Fix crossfade with RTL and non-default xalign




commit 9a52895fcd5a906791606400db1028fa0e527854
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Apr 19 16:21:09 2021 +0500

    squeezer: Fix crossfade with RTL and non-default xalign

 src/adw-squeezer.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/adw-squeezer.c b/src/adw-squeezer.c
index 9e2ac3c..bf376ac 100644
--- a/src/adw-squeezer.c
+++ b/src/adw-squeezer.c
@@ -781,10 +781,14 @@ adw_squeezer_snapshot_crossfade (GtkWidget   *widget,
   if (self->last_visible_child) {
     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);
+    float xalign = self->xalign;
+
+    if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+      xalign = 1 - xalign;
 
     gtk_snapshot_translate (snapshot,
                             &GRAPHENE_POINT_INIT (
-                              width_diff * self->xalign,
+                              width_diff * xalign,
                               height_diff * self->yalign
                             ));
 


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