[gnome-builder/wip/csoriano/fixing-vim-scrolling: 2/3] ide-source-view: Fix scroll adjusment offset



commit c4091393a23d622fd9b866a576dbe5aedd7e1842
Author: Carlos Soriano <csoriano gnome org>
Date:   Tue Apr 7 15:40:56 2015 +0200

    ide-source-view: Fix scroll adjusment offset
    
    We were adding a line to the yalign to make the last line of
    the rect visible, but that lead to a inconsistent scroll adjustment
    since the final yvalue was being modified even when not needed, since
    the difference between the iter_rect y and the calculation was always
    making a difference that, when far enough from the start, made a
    1 pixel difference that lend to a adjustment.

 libide/ide-source-view.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index 05d53c3..3166b29 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -6463,11 +6463,9 @@ ide_source_view_scroll_to_iter (IdeSourceView     *self,
   yoffset = (visible_rect.y - real_visible_rect.y) + (yalign * visible_rect.height);
 
   /*
-   * now convert those back to alignments in the real visible area, but leave
-   * enough space for an input character.
-   */
+   * now convert those back to alignments in the real visible area */
   xalign = xoffset / (gdouble)real_visible_rect.width;
-  yalign = yoffset / (gdouble)(real_visible_rect.height + priv->cached_char_height);
+  yalign = yoffset / (gdouble)real_visible_rect.height;
 
   yvalue = iter_rect.y - (yalign * real_visible_rect.height);
   xvalue = iter_rect.x - (xalign * real_visible_rect.width);


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