diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-24 23:29:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-24 23:29:24 +0400 |
commit | 8509e94d3ad69aaa2bb3b14c5669ea9d596e3fd0 (patch) | |
tree | f0d901361b5f0572c33a2520fca65a2be204903b /source/blender/editors/mask/mask_edit.c | |
parent | 72a106d56f4a224054aad911222a8206fd86b51d (diff) |
initial commit for supporting masks in the image view, currently active seq strip is used as the mask source.
also unify mask drawing code for clip/sequencer/image
Diffstat (limited to 'source/blender/editors/mask/mask_edit.c')
-rw-r--r-- | source/blender/editors/mask/mask_edit.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index 3ba198b60be..a739d88dbd4 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -42,6 +42,7 @@ #include "ED_screen.h" #include "ED_mask.h" /* own include */ +#include "ED_image.h" #include "ED_object.h" /* ED_keymap_proportional_maskmode only */ #include "ED_clip.h" #include "ED_sequencer.h" @@ -143,15 +144,25 @@ void ED_mask_size(const bContext *C, int *width, int *height) { ScrArea *sa = CTX_wm_area(C); if (sa && sa->spacedata.first) { - if (sa->spacetype == SPACE_CLIP) { - ED_space_clip_get_size(C, width, height); - return; - } - else if (sa->spacetype == SPACE_SEQ) { - Scene *scene = CTX_data_scene(C); - *width = (scene->r.size * scene->r.xsch) / 100; - *height = (scene->r.size * scene->r.ysch) / 100; - return; + switch (sa->spacetype) { + case SPACE_CLIP: + { + ED_space_clip_get_size(C, width, height); + return; + } + case SPACE_SEQ: + { + Scene *scene = CTX_data_scene(C); + *width = (scene->r.size * scene->r.xsch) / 100; + *height = (scene->r.size * scene->r.ysch) / 100; + return; + } + case SPACE_IMAGE: + { + SpaceImage *sima = sa->spacedata.first; + ED_space_image_size(sima, width, height); + return; + } } } |