diff options
author | Thomas White <taw@bitwiz.org.uk> | 2016-05-16 22:39:41 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2016-05-16 22:39:41 +0200 |
commit | 4ea72c5e6d460864527642e0c265f4ff1f70b6fe (patch) | |
tree | 8cf1bf3fad049b688af60d06cef21db9c798eb03 /src/sc_editor.c | |
parent | 4f64db34240d84acf0c8722dd279574ccb24f5cc (diff) |
Scroll/toolbar fixes
Diffstat (limited to 'src/sc_editor.c')
-rw-r--r-- | src/sc_editor.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c index a82ffc9..76be18d 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -89,6 +89,10 @@ static void vertical_adjust(GtkAdjustment *adj, SCEditor *e) static void set_vertical_params(SCEditor *e) { if ( e->vadj == NULL ) return; + if ( e->scroll_pos < 0.0 ) e->scroll_pos = 0.0; + if ( e->scroll_pos > e->h - e->visible_height ) { + e->scroll_pos = e->h - e->visible_height; + } gtk_adjustment_configure(e->vadj, e->scroll_pos, 0, e->h, 100, e->visible_height, e->visible_height); } @@ -1619,7 +1623,7 @@ void sc_editor_set_cursor_para(SCEditor *e, signed int pos) } if ( pos < 0 ) { - e->cursor_para = e->cursor_frame->n_paras; + e->cursor_para = e->cursor_frame->n_paras - 1; } else if ( pos >= e->cursor_frame->n_paras ) { e->cursor_para = e->cursor_frame->n_paras - 1; } else { |