Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_undo.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_undo.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_undo.c b/source/blender/editors/sculpt_paint/paint_image_undo.c
index 9d1987943a5..5308ef0fae8 100644
--- a/source/blender/editors/sculpt_paint/paint_image_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_image_undo.c
@@ -33,17 +33,19 @@
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
+#include "DNA_workspace_types.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "BKE_context.h"
-#include "BKE_depsgraph.h"
#include "BKE_image.h"
#include "BKE_main.h"
#include "BKE_global.h"
#include "BKE_undo_system.h"
+#include "DEG_depsgraph.h"
+
#include "ED_paint.h"
#include "GPU_draw.h"
@@ -339,7 +341,7 @@ static void image_undo_restore_list(bContext *C, ListBase *lb)
}
ibuf->userflags |= IB_DISPLAY_BUFFER_INVALID;
- DAG_id_tag_update(&ima->id, 0);
+ DEG_id_tag_update(&ima->id, 0);
BKE_image_release_ibuf(ima, ibuf, NULL);
}
@@ -392,17 +394,18 @@ typedef struct ImageUndoStep {
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 && (obact->mode & OB_MODE_TEXTURE_PAINT)) || (sima->mode == SI_MODE_PAINT)) {
+ if ((obact && (workspace->object_mode & OB_MODE_TEXTURE_PAINT)) || (sima->mode == SI_MODE_PAINT)) {
return true;
}
}
else if (sa && (sa->spacetype == SPACE_VIEW3D)) {
- if (obact && (obact->mode & OB_MODE_TEXTURE_PAINT)) {
+ if (obact && (workspace->object_mode & OB_MODE_TEXTURE_PAINT)) {
return true;
}
}