[gtk/issue-1505] a11y: Apply widget scaling factor




commit 411cd7c7275bdb5442b3e912d8df5c636b37a7a4
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sat Oct 17 17:18:09 2020 +0100

    a11y: Apply widget scaling factor
    
    Use the "real" widget bounds for the AtkComponent rectangle.
    
    Fixes: #1505

 gtk/a11y/gtkwidgetaccessible.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/a11y/gtkwidgetaccessible.c b/gtk/a11y/gtkwidgetaccessible.c
index d1cf7da80f..07c99d3db5 100644
--- a/gtk/a11y/gtkwidgetaccessible.c
+++ b/gtk/a11y/gtkwidgetaccessible.c
@@ -82,10 +82,12 @@ size_allocate_cb (GtkWidget     *widget,
   accessible = gtk_widget_get_accessible (widget);
   if (ATK_IS_COMPONENT (accessible))
     {
-      rect.x = allocation->x;
-      rect.y = allocation->y;
-      rect.width = allocation->width;
-      rect.height = allocation->height;
+      int scale = gtk_widget_get_scale_factor (widget);
+
+      rect.x = allocation->x * scale;
+      rect.y = allocation->y * scale;
+      rect.width = allocation->width * scale;
+      rect.height = allocation->height * scale;
       g_signal_emit_by_name (accessible, "bounds-changed", &rect);
     }
 }


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