From 4b955a60eda06526e3a793fd9bb3c942b641d877 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 20 Jun 2012 10:28:51 +0000 Subject: 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. --- source/blender/editors/space_clip/clip_draw.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/space_clip/clip_draw.c') 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]; -- cgit v1.2.3