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/space_clip/clip_utils.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/space_clip/clip_utils.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_utils.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c index 1c040c69fa9..d9c9f63e4a3 100644 --- a/source/blender/editors/space_clip/clip_utils.c +++ b/source/blender/editors/space_clip/clip_utils.c @@ -223,13 +223,14 @@ void clip_delete_marker(bContext *C, MovieClip *clip, ListBase *tracksbase, } } -void clip_view_center_to_point(SpaceClip *sc, float x, float y) +void clip_view_center_to_point(const bContext *C, float x, float y) { + SpaceClip *sc = CTX_wm_space_clip(C); int width, height; float aspx, aspy; - ED_space_clip_get_clip_size(sc, &width, &height); - ED_space_clip_get_clip_aspect(sc, &aspx, &aspy); + ED_space_clip_get_size(C, &width, &height); + ED_space_clip_get_aspect(sc, &aspx, &aspy); sc->xof = (x - 0.5f) * width * aspx; sc->yof = (y - 0.5f) * height * aspy; |