[gtk/matthiasc/for-master: 1/3] text: Set the hotspot for the drag icon




commit 5a8267dfaec8c097deac7646ae2fdc5dffdb790c
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Sep 6 20:46:42 2020 -0400

    text: Set the hotspot for the drag icon
    
    This makes the drag icon align properly with the
    dragged text at the beginning of the drag.

 gtk/gtktext.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 7e2f2308eb..4fa9a77b21 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -2986,7 +2986,9 @@ gtk_text_drag_gesture_update (GtkGestureDrag *gesture,
           g_signal_connect (drag, "cancel", G_CALLBACK (dnd_cancel_cb), self);
 
           paintable = gtk_text_util_create_drag_icon (widget, text, -1);
-          gtk_drag_icon_set_from_paintable (drag, paintable, ranges[0], 0);
+          gtk_drag_icon_set_from_paintable (drag, paintable,
+                                            (priv->drag_start_x - ranges[0]),
+                                            priv->drag_start_y);
           g_clear_object (&paintable);
 
           priv->drag = drag;


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