textview: fix yoffset position when top_margin is set
authorChristian Hergert <chergert@redhat.com>
Thu, 29 Jul 2021 23:45:04 +0000 (16:45 -0700)
committerChristian Hergert <chergert@redhat.com>
Thu, 29 Jul 2021 23:45:04 +0000 (16:45 -0700)
This doesn't need to be included in the calculation or it will cause the
yoffset to continually shift while the window is resized.

Fixes #4134

gtk/gtktextview.c

index 71c48ab844302abaeb5cc69594bb0f3ffea839cd..3f5836f0aa9f2dcff2d40b240f63e3b99fb893c4 100644 (file)
@@ -4892,7 +4892,7 @@ changed_handler (GtkTextLayout     *layout,
 
       gtk_text_layout_get_line_yrange (layout, &first, &new_first_para_top, NULL);
 
-      old_first_para_top = priv->yoffset - priv->first_para_pixels + priv->top_margin;
+      old_first_para_top = priv->yoffset - priv->first_para_pixels;
 
       if (new_first_para_top != old_first_para_top)
         {