diff options
author | Thomas White <taw@bitwiz.org.uk> | 2016-09-19 22:45:05 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2016-09-19 22:45:05 +0200 |
commit | 0ec2475e8ab0c8ef8d4edabeb5833d252c16dd76 (patch) | |
tree | 86163b03ec4d1e6bbab254c8a3dfe56c901b5bca | |
parent | 0de6299db5cd5cb6754881633ed9f14aaa57fdf8 (diff) |
Set page size correctly for scroll adjustment
Fixes bad rendering on old GTK
-rw-r--r-- | src/sc_editor.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c index c050cea..2627b5a 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -88,6 +88,8 @@ static void vertical_adjust(GtkAdjustment *adj, SCEditor *e) static void set_vertical_params(SCEditor *e) { + double page; + if ( e->vadj == NULL ) return; /* Ensure we do not scroll off the top of the document */ @@ -103,8 +105,14 @@ static void set_vertical_params(SCEditor *e) e->scroll_pos = 0.0; } + if ( e->h > e->visible_height ) { + page = e->visible_height; + } else { + page = e->h; + } + gtk_adjustment_configure(e->vadj, e->scroll_pos, 0, e->h, 100, - e->visible_height, e->visible_height); + e->visible_height, page); } |