diff options
-rw-r--r-- | source/blender/editors/space_image/image_edit.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 5 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 7 |
3 files changed, 9 insertions, 14 deletions
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c index c0b6dc656c2..58e6a1aa94a 100644 --- a/source/blender/editors/space_image/image_edit.c +++ b/source/blender/editors/space_image/image_edit.c @@ -371,7 +371,7 @@ int ED_space_image_maskedit_poll(bContext *C) { SpaceImage *sima = CTX_wm_space_image(C); - if (sima && sima->image) { + if (sima) { Scene *scene = CTX_data_scene(C); return ED_space_image_check_show_maskedit(scene, sima); } @@ -382,13 +382,8 @@ int ED_space_image_maskedit_poll(bContext *C) int ED_space_image_maskedit_mask_poll(bContext *C) { if (ED_space_image_maskedit_poll(C)) { - Image *ima = CTX_data_edit_image(C); - - if (ima) { - SpaceImage *sima = CTX_wm_space_image(C); - - return sima->mask_info.mask != NULL; - } + SpaceImage *sima = CTX_wm_space_image(C); + return sima->mask_info.mask != NULL; } return FALSE; diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 0007ef2ef77..31fa1f805f9 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -411,9 +411,6 @@ static void image_refresh(const bContext *C, ScrArea *sa) static void image_listener(ScrArea *sa, wmNotifier *wmn) { SpaceImage *sima = (SpaceImage *)sa->spacedata.first; - - /* grr, prevent feedback loop */ - const int show_mask = (sima->image && (sima->image->source == IMA_SRC_VIEWER && sima->mode == SI_MODE_MASK)); /* context changes */ switch (wmn->category) { @@ -429,8 +426,6 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn) case ND_COMPO_RESULT: if (ED_space_image_show_render(sima)) image_scopes_tag_refresh(sa); - if (!show_mask) - ED_area_tag_refresh(sa); ED_area_tag_redraw(sa); break; } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 278acb72511..fcb857be4e0 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -2135,7 +2135,12 @@ static void applyGrid(TransInfo *t, float *val, int max_index, float fac[3], Gea /* evil hack - snapping needs to be adapted for image aspect ratio */ if ((t->spacetype == SPACE_IMAGE) && (t->mode == TFM_TRANSLATION)) { - ED_space_image_get_uv_aspect(t->sa->spacedata.first, asp, asp + 1); + if (t->options & CTX_MASK) { + ED_space_image_get_aspect(t->sa->spacedata.first, asp, asp + 1); + } + else { + ED_space_image_get_uv_aspect(t->sa->spacedata.first, asp, asp + 1); + } } for (i = 0; i <= max_index; i++) { |