From 3821e7a7505a2f83938a6d5f9120ebb7771bfcd9 Mon Sep 17 00:00:00 2001 From: RichardHitt Date: Thu, 14 Nov 2013 19:18:07 -0800 Subject: Fixes #836. Move to line boundary in _scroll{down,up}_timeout() not _scroll(). --- src/fe-gtk/xtext.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index 684465aa..f9161b7b 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -1341,6 +1341,7 @@ gtk_xtext_scrolldown_timeout (GtkXText * xtext) return 0; } + adj->value = (int)adj->value; /* Align to line boundary */ xtext->select_start_y -= xtext->fontsize; xtext->select_start_adj++; adj->value++; @@ -1373,6 +1374,7 @@ gtk_xtext_scrollup_timeout (GtkXText * xtext) return 0; } + adj->value = (int)adj->value; /* Align to line boundary */ xtext->select_start_y += xtext->fontsize; xtext->select_start_adj--; adj->value--; @@ -2125,14 +2127,14 @@ gtk_xtext_scroll (GtkWidget *widget, GdkEventScroll *event) new_value = xtext->adj->value - (xtext->adj->page_increment / 10); if (new_value < xtext->adj->lower) new_value = xtext->adj->lower; - gtk_adjustment_set_value (xtext->adj, (int)new_value); + gtk_adjustment_set_value (xtext->adj, new_value); } else if (event->direction == GDK_SCROLL_DOWN) /* mouse wheel pageDn */ { new_value = xtext->adj->value + (xtext->adj->page_increment / 10); if (new_value > (xtext->adj->upper - xtext->adj->page_size)) new_value = xtext->adj->upper - xtext->adj->page_size; - gtk_adjustment_set_value (xtext->adj, (int)new_value); + gtk_adjustment_set_value (xtext->adj, new_value); } return FALSE; -- cgit 1.4.1