diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-07 23:24:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-07 23:24:49 +0400 |
commit | 36db2a2cff58d3bd3dd0f7e8e0d2fbec36e32412 (patch) | |
tree | 5430539bfad43c3bcbae3ee54d6a0f458a67a43a /source/blender/editors/mask/mask_edit.c | |
parent | 186f542b791a97ea151bcc9a28b6a7edcfdb358b (diff) |
initial support for editing masks in the sequencer, currently only draw the mask.
Diffstat (limited to 'source/blender/editors/mask/mask_edit.c')
-rw-r--r-- | source/blender/editors/mask/mask_edit.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index 9bfcd2a9886..6a59279934e 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -35,6 +35,8 @@ #include "BKE_context.h" #include "BKE_mask.h" +#include "DNA_scene_types.h" + #include "WM_api.h" #include "WM_types.h" @@ -132,16 +134,24 @@ void ED_mask_point_pos__reverse(bContext *C, float x, float y, float *xr, float void ED_mask_size(bContext *C, int *width, int *height) { - SpaceClip *sc = CTX_wm_space_clip(C); - - if (sc) { - ED_space_clip_mask_size(sc, width, height); - } - else { - /* possible other spaces from which mask editing is available */ - *width = 0; - *height = 0; + ScrArea *sa = CTX_wm_area(C); + if (sa && sa->spacedata.first) { + if (sa->spacetype == SPACE_CLIP) { + SpaceClip *sc = sa->spacedata.first; + ED_space_clip_mask_size(sc, 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; + } } + + /* possible other spaces from which mask editing is available */ + *width = 0; + *height = 0; } void ED_mask_aspect(bContext *C, float *aspx, float *aspy) |