Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-08-15 22:41:43 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-08-15 23:44:25 +0300
commit8f565f5a6ffa4f6170caca2de50a733e8c72367a (patch)
tree95545357cdaefc10a0d11821c82a483c9aa382cb /source/blender/editors/gpencil/annotate_paint.c
parent266e7b67fd3e2c219d8646e37a2fb3e393df4bda (diff)
WM: reuse visible region calculation
Avoids calculating the visible part of a region whenever on-screen overlays are drawn.
Diffstat (limited to 'source/blender/editors/gpencil/annotate_paint.c')
-rw-r--r--source/blender/editors/gpencil/annotate_paint.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index c9c4a67644e..07b61751b22 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -2242,11 +2242,9 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
}
else if (p->ar) {
- rcti region_rect;
-
- /* Perform bounds check using */
- ED_region_visible_rect(p->ar, &region_rect);
- in_bounds = BLI_rcti_isect_pt_v(&region_rect, event->mval);
+ /* Perform bounds check. */
+ const rcti *region_rect = ED_region_visible_rect(p->ar);
+ in_bounds = BLI_rcti_isect_pt_v(region_rect, event->mval);
}
else {
/* No region */