[gtk/matthiasc/for-master: 2/2] stylecontext: Respect cursor aspect ratio everywhere



commit ff53d5ba112233a1dbd47d834481f4c3b05a874b
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Apr 12 11:27:56 2020 -0400

    stylecontext: Respect cursor aspect ratio everywhere
    
    We were using the new cursor aspect ratio setting in
    the snapshotting code, but not in gtk_render_insertion_cursor.
    
    Make them both behave the same.

 gtk/gtkstylecontext.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index ab087433e1..15e0085537 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -1251,6 +1251,7 @@ gtk_render_insertion_cursor (GtkStyleContext *context,
 {
   GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context);
   gboolean split_cursor;
+  float aspect_ratio;
   PangoRectangle strong_pos, weak_pos;
   PangoRectangle *cursor1, *cursor2;
   GdkDevice *keyboard;
@@ -1264,6 +1265,7 @@ gtk_render_insertion_cursor (GtkStyleContext *context,
 
   g_object_get (gtk_settings_get_for_display (priv->display),
                 "gtk-split-cursor", &split_cursor,
+                "gtk-cursor-aspect-ratio", &aspect_ratio,
                 NULL);
 
   keyboard = gdk_seat_get_keyboard (gdk_display_get_default_seat (priv->display));
@@ -1296,7 +1298,7 @@ gtk_render_insertion_cursor (GtkStyleContext *context,
                          x + PANGO_PIXELS (cursor1->x),
                          y + PANGO_PIXELS (cursor1->y),
                          PANGO_PIXELS (cursor1->height),
-                         0.04,
+                         aspect_ratio,
                          TRUE,
                          direction,
                          direction2 != PANGO_DIRECTION_NEUTRAL);
@@ -1308,7 +1310,7 @@ gtk_render_insertion_cursor (GtkStyleContext *context,
                              x + PANGO_PIXELS (cursor2->x),
                              y + PANGO_PIXELS (cursor2->y),
                              PANGO_PIXELS (cursor2->height),
-                             0.04,
+                             aspect_ratio,
                              FALSE,
                              direction2,
                              TRUE);


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