diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-13 03:04:05 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-13 03:04:05 +0400 |
commit | a53e864cf4b5f2a37f34602469c0998ec7cd5ad4 (patch) | |
tree | b97b80cbe53abcc3c025bd61e2abf0e1f9f0aeca /source/blender/editors/space_text/text_draw.c | |
parent | 51b9d85b091cbc31d73968f0652e59dd83247ca2 (diff) |
Fix T37572: text editor scrolling not working well with Mac trackpad panning.
The trackpad would give isolated mouse pan events with a distance smaller than
one line or character. For other 2D views this is all accumulated in floats,
but in the text editor it only keeps track of integers, and the small mouse pan
events got lost due to rounding.
Now it keeps track of sub-line or sub-character scroll offsets to avoid this.
Diffstat (limited to 'source/blender/editors/space_text/text_draw.c')
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index e92cab72042..4504963a572 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1495,6 +1495,9 @@ void text_scroll_to_cursor(SpaceText *st, ScrArea *sa) if (st->top < 0) st->top = 0; if (st->left < 0) st->left = 0; + + st->scroll_accum[0] = 0.0f; + st->scroll_accum[1] = 0.0f; } void text_update_cursor_moved(bContext *C) |