diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-08-15 22:41:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-08-15 23:44:25 +0300 |
commit | 8f565f5a6ffa4f6170caca2de50a733e8c72367a (patch) | |
tree | 95545357cdaefc10a0d11821c82a483c9aa382cb /source/blender/editors/gpencil/annotate_draw.c | |
parent | 266e7b67fd3e2c219d8646e37a2fb3e393df4bda (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_draw.c')
-rw-r--r-- | source/blender/editors/gpencil/annotate_draw.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c index dce6ed29c05..697d06aa098 100644 --- a/source/blender/editors/gpencil/annotate_draw.c +++ b/source/blender/editors/gpencil/annotate_draw.c @@ -936,7 +936,6 @@ static void annotation_draw_data_layers( /* draw a short status message in the top-right corner */ static void annotation_draw_status_text(const bGPdata *gpd, ARegion *ar) { - rcti rect; /* Cannot draw any status text when drawing OpenGL Renders */ if (G.f & G_FLAG_RENDER_VIEWPORT) { @@ -944,7 +943,7 @@ static void annotation_draw_status_text(const bGPdata *gpd, ARegion *ar) } /* Get bounds of region - Necessary to avoid problems with region overlap */ - ED_region_visible_rect(ar, &rect); + const rcti *rect = ED_region_visible_rect(ar); /* for now, this should only be used to indicate when we are in stroke editmode */ if (gpd->flag & GP_DATA_STROKE_EDITMODE) { @@ -956,8 +955,8 @@ static void annotation_draw_status_text(const bGPdata *gpd, ARegion *ar) BLF_width_and_height( font_id, printable, BLF_DRAW_STR_DUMMY_MAX, &printable_size[0], &printable_size[1]); - int xco = (rect.xmax - U.widget_unit) - (int)printable_size[0]; - int yco = (rect.ymax - U.widget_unit); + int xco = (rect->xmax - U.widget_unit) - (int)printable_size[0]; + int yco = (rect->ymax - U.widget_unit); /* text label */ UI_FontThemeColor(font_id, TH_TEXT_HI); |