Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / space_view3d / view3d_draw_legacy.c
index 6184ed63543b3403da04538d4fedd20b922997e7..73ffe9498239437cebda11c90362dab33ef251f1 100644 (file)
@@ -1291,9 +1291,15 @@ void ED_view3d_draw_select_loop(
         const struct EvaluationContext *eval_ctx, ViewContext *vc, Scene *scene, SceneLayer *sl,
         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(eval_ctx, scene, sl, ar, v3d, BASACT_NEW(sl), dflag);
        }
@@ -1336,6 +1342,8 @@ void ED_view3d_draw_select_loop(
                        }
                }
        }
+
+       UI_Theme_Restore(&theme_state);
 }
 
 typedef struct View3DShadow {