diff options
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_undo.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_undo.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_undo.c b/source/blender/editors/sculpt_paint/paint_image_undo.c index e9b6f5a410b..ade775d14e6 100644 --- a/source/blender/editors/sculpt_paint/paint_image_undo.c +++ b/source/blender/editors/sculpt_paint/paint_image_undo.c @@ -407,18 +407,17 @@ static void paint_undosys_step_decode_restore_ids(ImageUndoStep *us) static bool image_undosys_poll(bContext *C) { - const WorkSpace *workspace = CTX_wm_workspace(C); Object *obact = CTX_data_active_object(C); ScrArea *sa = CTX_wm_area(C); if (sa && (sa->spacetype == SPACE_IMAGE)) { SpaceImage *sima = (SpaceImage *)sa->spacedata.first; - if ((obact && (workspace->object_mode & OB_MODE_TEXTURE_PAINT)) || (sima->mode == SI_MODE_PAINT)) { + if ((obact && (obact->mode & OB_MODE_TEXTURE_PAINT)) || (sima->mode == SI_MODE_PAINT)) { return true; } } else if (sa && (sa->spacetype == SPACE_VIEW3D)) { - if (obact && (workspace->object_mode & OB_MODE_TEXTURE_PAINT)) { + if (obact && (obact->mode & OB_MODE_TEXTURE_PAINT)) { return true; } } |