WM: move theme check out of ED_view3d_draw_select_loop

In 2.8x this needs to be in view3d_opengl_select,
so simplest to make in master too.
This commit is contained in:
Campbell Barton 2017-08-27 00:48:52 +10:00
parent fa365d5f2f
commit 7e43210edb
2 changed files with 9 additions and 7 deletions

View File

@ -2523,14 +2523,9 @@ void ED_view3d_draw_select_loop(
ViewContext *vc, Scene *scene, View3D *v3d, ARegion *ar,
bool use_obedit_skip, bool use_nearest)
{
struct bThemeState theme_state;
short code = 1;
const short dflag = DRAW_PICKING | DRAW_CONSTCOLOR;
/* Tools may request depth outside of regular drawing code. */
UI_Theme_Store(&theme_state);
UI_SetTheme(SPACE_VIEW3D, RGN_TYPE_WINDOW);
if (vc->obedit && vc->obedit->type == OB_MBALL) {
draw_object(scene, ar, v3d, BASACT, dflag);
}
@ -2574,8 +2569,6 @@ void ED_view3d_draw_select_loop(
}
}
}
UI_Theme_Restore(&theme_state);
}
typedef struct View3DShadow {

View File

@ -54,6 +54,8 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "UI_resources.h"
#include "GPU_select.h"
#include "WM_api.h"
@ -1206,6 +1208,7 @@ int view3d_opengl_select(
ViewContext *vc, unsigned int *buffer, unsigned int bufsize, const rcti *input,
eV3DSelectMode select_mode)
{
struct bThemeState theme_state;
Scene *scene = vc->scene;
View3D *v3d = vc->v3d;
ARegion *ar = vc->ar;
@ -1250,6 +1253,10 @@ int view3d_opengl_select(
}
}
/* Tools may request depth outside of regular drawing code. */
UI_Theme_Store(&theme_state);
UI_SetTheme(SPACE_VIEW3D, RGN_TYPE_WINDOW);
/* Re-use cache (rect must be smaller then the cached)
* other context is assumed to be unchanged */
if (GPU_select_is_cached()) {
@ -1302,6 +1309,8 @@ int view3d_opengl_select(
finally:
if (hits < 0) printf("Too many objects in select buffer\n"); /* XXX make error message */
UI_Theme_Restore(&theme_state);
return hits;
}