Fix T92800: (UI) Radial control values get wrong color assigned

The global theme state didn't get updated or unset properly when drawing
overlays. Now paint cursors use the theme settings of the space they are
in, while global overlays use the global fallback, which is the main 3D
View region.
This commit is contained in:
Julian Eisel 2021-11-04 11:49:25 +01:00
parent 978ef093db
commit c641107c95
Notes: blender-bot 2023-04-26 01:42:00 +02:00
Referenced by issue #93998, UV Editor has no 'View Overlay' Theme option
Referenced by issue #92800, UI: Radial control values get wrong color assigned
1 changed files with 3 additions and 0 deletions

View File

@ -108,6 +108,8 @@ static void wm_paintcursor_draw(bContext *C, ScrArea *area, ARegion *region)
}
if (pc->poll == NULL || pc->poll(C)) {
UI_SetTheme(area->spacetype, region->regiontype);
/* Prevent drawing outside region. */
GPU_scissor_test(true);
GPU_scissor(region->winrct.xmin,
@ -839,6 +841,7 @@ static void wm_draw_window_onscreen(bContext *C, wmWindow *win, int view)
}
/* After area regions so we can do area 'overlay' drawing. */
UI_SetTheme(0, 0);
ED_screen_draw_edges(win);
wm_draw_callbacks(win);
wmWindowViewport(win);