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_draw.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_draw.c')
-rw-r--r-- | source/blender/editors/space_clip/clip_draw.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 9b9e2223ae6..936c462a161 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -1408,19 +1408,23 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, glPopMatrix(); } -void clip_draw_main(SpaceClip *sc, ARegion *ar, Scene *scene) +void clip_draw_main(const bContext *C, ARegion *ar) { + SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); + Scene *scene = CTX_data_scene(C); ImBuf *ibuf; int width, height; float zoomx, zoomy; + ED_space_clip_get_size(C, &width, &height); + ED_space_clip_get_zoom(C, &zoomx, &zoomy); + /* if no clip, nothing to do */ - if (!clip) + if (!clip) { + ED_region_grid_draw(ar, zoomx, zoomy); return; - - ED_space_clip_get_clip_size(sc, &width, &height); - ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); + } if (sc->flag & SC_SHOW_STABLE) { float smat[4][4], ismat[4][4]; |