From 284e0ea756854e3d8388b2cd89666923975cbf10 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Fri, 15 Jun 2018 10:25:18 +0200 Subject: Fix (unreported) Text Editor: scrollbar exiting early caused by recent clickdrag changes --- source/blender/editors/space_text/text_ops.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/space_text/text_ops.c') diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index de5ff36f462..52440be4c4b 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2243,13 +2243,15 @@ static int text_scroll_modal(bContext *C, wmOperator *op, const wmEvent *event) case LEFTMOUSE: case RIGHTMOUSE: case MIDDLEMOUSE: - if (ELEM(tsc->zone, SCROLLHANDLE_MIN_OUTSIDE, SCROLLHANDLE_MAX_OUTSIDE)) { - txt_screen_skip(st, ar, st->viewlines * (tsc->zone == SCROLLHANDLE_MIN_OUTSIDE ? 1 : -1)); + if (event->val == KM_RELEASE) { + if (ELEM(tsc->zone, SCROLLHANDLE_MIN_OUTSIDE, SCROLLHANDLE_MAX_OUTSIDE)) { + txt_screen_skip(st, ar, st->viewlines * (tsc->zone == SCROLLHANDLE_MIN_OUTSIDE ? 1 : -1)); - ED_area_tag_redraw(CTX_wm_area(C)); + ED_area_tag_redraw(CTX_wm_area(C)); + } + scroll_exit(C, op); + return OPERATOR_FINISHED; } - scroll_exit(C, op); - return OPERATOR_FINISHED; } return OPERATOR_RUNNING_MODAL; -- cgit v1.2.3