Cleanup: better comments and naming for redraw flags

This commit is contained in:
Brecht Van Lommel 2019-06-02 02:09:12 +02:00
parent f332a71180
commit 114973584d
2 changed files with 17 additions and 8 deletions

View File

@ -375,12 +375,12 @@ static void ui_block_region_refresh(const bContext *C, ARegion *ar)
ARegion *ctx_region = CTX_wm_region(C);
uiBlock *block;
if (ar->do_draw & RGN_DRAW_REFRESH_UI) {
if (ar->do_draw & RGN_REFRESH_UI) {
ScrArea *handle_ctx_area;
ARegion *handle_ctx_region;
uiBlock *block_next;
ar->do_draw &= ~RGN_DRAW_REFRESH_UI;
ar->do_draw &= ~RGN_REFRESH_UI;
for (block = ar->uiblocks.first; block; block = block_next) {
block_next = block->next;
uiPopupBlockHandle *handle = block->handle;
@ -772,7 +772,7 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C,
handle->ctx_area = CTX_wm_area(C);
handle->ctx_region = CTX_wm_region(C);
/* store vars to refresh popup (RGN_DRAW_REFRESH_UI) */
/* store vars to refresh popup (RGN_REFRESH_UI) */
handle->popup_create_vars.create_func = create_func;
handle->popup_create_vars.handle_create_func = handle_create_func;
handle->popup_create_vars.arg = arg;

View File

@ -640,10 +640,19 @@ enum {
};
/** #ARegion.do_draw */
#define RGN_DRAW 1
#define RGN_DRAW_PARTIAL 2
#define RGN_DRAWING 4
#define RGN_DRAW_REFRESH_UI 8 /* re-create uiBlock's where possible */
#define RGN_DRAW_NO_REBUILD 16
enum {
/* Region must be fully redrawn. */
RGN_DRAW = 1,
/* Redraw only part of region, for sculpting and painting to get smoother
* stroke painting on heavy meshes. */
RGN_DRAW_PARTIAL = 2,
/* For outliner, to do faster redraw without rebuilding outliner tree. */
RGN_DRAW_NO_REBUILD = 4,
/* Set while region is being drawn. */
RGN_DRAWING = 8,
/* For popups, to refresh UI layout along with drawing. */
RGN_REFRESH_UI = 16,
};
#endif /* __DNA_SCREEN_TYPES_H__ */