diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-20 14:28:51 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-20 14:28:51 +0400 |
commit | 4b955a60eda06526e3a793fd9bb3c942b641d877 (patch) | |
tree | e5706d5afef06f2b2e09b4022bfb537acf5d24d8 /source/blender/editors/mask/mask_edit.c | |
parent | fca0112ba3e534c90fd0afaca9e901bc9c022b47 (diff) |
Cleanup up space clip API:
- Remove clip/mask specific size/aspect getters, they shall just
use the same size/aspect ratio.
- Made size getter (and some other public functions) accept context
instead of SpaceClip. Currently only SpaceClip is being get from
this context, but later it'll be helpful when adding support of
editing mask without opening clip in clip editor (in this case
using render resolution for mask would be ideal, but this
requires knowing scene in size getter).
- Rearrange some functions in clip_editor.c for easier navigation
in the file.
Diffstat (limited to 'source/blender/editors/mask/mask_edit.c')
-rw-r--r-- | source/blender/editors/mask/mask_edit.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index fdf72043464..76fc7126cf2 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -121,7 +121,7 @@ void ED_mask_point_pos__reverse(const bContext *C, float x, float y, float *xr, co[0] = x; co[1] = y; BKE_mask_coord_to_movieclip(sc->clip, &sc->user, co, co); - ED_clip_point_stable_pos__reverse(sc, ar, co, co); + ED_clip_point_stable_pos__reverse(C, co, co); } else { /* possible other spaces from which mask editing is available */ @@ -137,8 +137,7 @@ 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) { - SpaceClip *sc = sa->spacedata.first; - ED_space_clip_get_mask_size(sc, width, height); + ED_space_clip_get_size(C, width, height); return; } else if (sa->spacetype == SPACE_SEQ) { @@ -159,7 +158,7 @@ void ED_mask_aspect(const bContext *C, float *aspx, float *aspy) SpaceClip *sc = CTX_wm_space_clip(C); if (sc) { - ED_space_clip_get_mask_aspect(sc, aspx, aspy); + ED_space_clip_get_aspect(sc, aspx, aspy); } else { /* possible other spaces from which mask editing is available */ @@ -173,13 +172,12 @@ void ED_mask_pixelspace_factor(const bContext *C, float *scalex, float *scaley) SpaceClip *sc = CTX_wm_space_clip(C); if (sc) { - ARegion *ar = CTX_wm_region(C); int width, height; float zoomx, zoomy, aspx, aspy; - ED_space_clip_get_clip_size(sc, &width, &height); - ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); - ED_space_clip_get_clip_aspect(sc, &aspx, &aspy); + ED_space_clip_get_size(C, &width, &height); + ED_space_clip_get_zoom(C, &zoomx, &zoomy); + ED_space_clip_get_aspect(sc, &aspx, &aspy); *scalex = ((float)width * aspx) * zoomx; *scaley = ((float)height * aspy) * zoomy; |