Fix T64178: Invisible image 2D cursor

Own error in 928becec60, move cursor drawing to single location.
This commit is contained in:
Campbell Barton 2019-05-06 12:55:54 +10:00
parent 0ddec50944
commit f999c40d77
Notes: blender-bot 2023-02-14 10:29:30 +01:00
Referenced by issue #64178, the 2d cursor is invisible
1 changed files with 6 additions and 8 deletions

View File

@ -567,7 +567,8 @@ static void image_main_region_draw(const bContext *C, ARegion *ar)
Object *obedit = CTX_data_edit_object(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Mask *mask = NULL;
bool curve = false;
bool show_uvedit = false;
bool show_curve = false;
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
View2D *v2d = &ar->v2d;
@ -609,13 +610,13 @@ static void image_main_region_draw(const bContext *C, ARegion *ar)
/* check for mask (delay draw) */
if (ED_space_image_show_uvedit(sima, obedit)) {
/* pass */
show_uvedit = true;
}
else if (sima->mode == SI_MODE_MASK) {
mask = ED_space_image_get_mask(sima);
}
else if (ED_space_image_paint_curve(C)) {
curve = true;
show_curve = true;
}
ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
@ -669,12 +670,9 @@ static void image_main_region_draw(const bContext *C, ARegion *ar)
false,
NULL,
C);
UI_view2d_view_ortho(v2d);
ED_image_draw_cursor(ar, sima->cursor);
UI_view2d_view_restore(C);
}
else if (curve) {
if (show_uvedit || mask || show_curve) {
UI_view2d_view_ortho(v2d);
ED_image_draw_cursor(ar, sima->cursor);
UI_view2d_view_restore(C);