[gtk/issue-1505] a11y: Apply widget scaling factor
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/issue-1505] a11y: Apply widget scaling factor
- Date: Sat, 17 Oct 2020 16:19:36 +0000 (UTC)
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]