diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-07 10:14:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-07 10:19:46 +0300 |
commit | 767a39572772a5252a993159aa4d9eb64bf936b6 (patch) | |
tree | a62f0d9c73cdeb73772a7459f11ab1052077a124 /source/blender/editors/screen/screen_ops.c | |
parent | 0bd61227c246a488bd06b76fba213c44448379c7 (diff) |
Fix redraws from non-existing scrollbars
Cursor motion was often causing redraws.
Distance to scrollbars that don't exist in hidden regions
caused redraws (for alpha fading).
Check if scrollbars are used before calculating fade.
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 5377ccb5a44..8c28d73f44b 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -740,8 +740,16 @@ static AZone *area_actionzone_refresh_xy(ScrArea *sa, const int xy[2], const boo else if (az->type == AZONE_REGION_SCROLL) { ARegion *ar = az->ar; View2D *v2d = &ar->v2d; - const short isect_value = UI_view2d_mouse_in_scrollers(ar, v2d, xy[0], xy[1]); - if (test_only) { + int scroll_flag = 0; + const int isect_value = UI_view2d_mouse_in_scrollers_ex(ar, v2d, xy[0], xy[1], &scroll_flag); + + /* Check if we even have scroll bars. */ + if (((az->direction == AZ_SCROLL_HOR) && !(scroll_flag & V2D_SCROLL_HORIZONTAL)) || + ((az->direction == AZ_SCROLL_VERT) && !(scroll_flag & V2D_SCROLL_VERTICAL))) + { + /* no scrollbars, do nothing. */ + } + else if (test_only) { if (isect_value != 0) { break; } |