summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-04-28 14:10:07 -0400
committerMatthias Clasen <mclasen@redhat.com>2023-04-28 15:05:39 -0400
commit79119e64f9e6c22edd600fb439a2d0a991e136b4 (patch)
tree18aa137437409b1cc9e6b3cac0f9d660e86f40e0
parent37b2b3cb8320da9bc131d03fc5dd85de7d6a34ff (diff)
downloadgtk+-79119e64f9e6c22edd600fb439a2d0a991e136b4.tar.gz
tetview: Stop using gtk_widget_get_allocation
-rw-r--r--gtk/gtktextview.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 3c25b5fb5a..d2ca707b83 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -5248,13 +5248,10 @@ gtk_text_view_show_magnifier (GtkTextView *text_view,
{
cairo_rectangle_int_t rect;
GtkTextViewPrivate *priv;
- GtkAllocation allocation;
GtkRequisition req;
#define N_LINES 1
- gtk_widget_get_allocation (GTK_WIDGET (text_view), &allocation);
-
priv = text_view->priv;
_gtk_text_view_ensure_magnifier (text_view);
@@ -5273,11 +5270,10 @@ gtk_text_view_show_magnifier (GtkTextView *text_view,
_gtk_magnifier_set_coords (GTK_MAGNIFIER (priv->magnifier),
rect.x, rect.y + rect.height / 2);
- rect.x = CLAMP (rect.x, 0, allocation.width);
+ rect.x = CLAMP (rect.x, 0, gtk_widget_get_width (GTK_WIDGET (text_view)));
rect.y += rect.height / 4;
rect.height -= rect.height / 4;
- gtk_popover_set_pointing_to (GTK_POPOVER (priv->magnifier_popover),
- &rect);
+ gtk_popover_set_pointing_to (GTK_POPOVER (priv->magnifier_popover), &rect);
gtk_popover_popup (GTK_POPOVER (priv->magnifier_popover));