Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / space_text / text_ops.c
index eb014af2d5907d4c3e9ada8ac7a98694d8f3c979..e34edc8908f31430b306b5eda6b9db612981f4ac 100644 (file)
@@ -2245,13 +2245,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;