[gtk+] texthandle: Fix Y positioning of text handles



commit cfaa4214337c3cb529ba2f415f5581e0ca44de66
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Oct 14 17:21:25 2015 +0200

    texthandle: Fix Y positioning of text handles
    
    It is assumed that border.top is the same than pointing_to.height (which
    equals the strong cursor position), which is not since some time ago.
    
    The border calculation has been move on top too, it is now used in the
    Y position one, and doesn't depend on anything we calculate later.

 gtk/gtktexthandle.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtktexthandle.c b/gtk/gtktexthandle.c
index 8334887..d574566 100644
--- a/gtk/gtktexthandle.c
+++ b/gtk/gtktexthandle.c
@@ -391,14 +391,17 @@ _gtk_text_handle_update (GtkTextHandle         *handle,
 
       _gtk_text_handle_ensure_widget (handle, pos);
       _gtk_text_handle_get_size (handle, &width, &height);
-      rect.x = handle_window->pointing_to.x;
-      rect.y = handle_window->pointing_to.y;
-      rect.width = width;
-      rect.height = 0;
 
+      border->top = height;
+      border->bottom = height;
       border->left = width;
       border->right = width;
 
+      rect.x = handle_window->pointing_to.x;
+      rect.y = handle_window->pointing_to.y + handle_window->pointing_to.height - handle_window->border.top;
+      rect.width = width;
+      rect.height = 0;
+
       _handle_update_child_visible (handle, pos);
 
       window = gtk_widget_get_parent (handle_window->widget);
@@ -414,9 +417,6 @@ _gtk_text_handle_update (GtkTextHandle         *handle,
                 handle_window->dir != GTK_TEXT_DIR_RTL))
         rect.x -= rect.width;
 
-      border->top = height;
-      border->bottom = height;
-
       /* The goal is to make the window 3 times as wide and high. The handle
        * will be rendered in the center, making the rest an invisible border.
        * If we hit the edge of the toplevel, we shrink the border to avoid


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