Movie clip: display stabilization border even if current frame failed to load
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 10 Nov 2012 19:11:34 +0000 (19:11 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 10 Nov 2012 19:11:34 +0000 (19:11 +0000)
source/blender/editors/space_clip/clip_draw.c

index a2e4da719e9ed0d87e9ac99b739625da75429fc0..02716c20588c4c3ff8a2e9beaae883aec13d339b 100644 (file)
@@ -252,7 +252,6 @@ static void draw_movieclip_buffer(const bContext *C, SpaceClip *sc, ARegion *ar,
                                   int width, int height, float zoomx, float zoomy)
 {
        int x, y;
-       MovieClip *clip = ED_space_clip_get_clip(sc);
 
        /* find window pixel coordinates of origin */
        UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x, &y);
@@ -306,6 +305,15 @@ static void draw_movieclip_buffer(const bContext *C, SpaceClip *sc, ARegion *ar,
 
                IMB_display_buffer_release(cache_handle);
        }
+}
+
+static void draw_stabilization_border(SpaceClip *sc, ARegion *ar, int width, int height, float zoomx, float zoomy)
+{
+       int x, y;
+       MovieClip *clip = ED_space_clip_get_clip(sc);
+
+       /* find window pixel coordinates of origin */
+       UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x, &y);
 
        /* draw boundary border for frame if stabilization is enabled */
        if (sc->flag & SC_SHOW_STABLE && clip->tracking.stabilization.flag & TRACKING_2D_STABILIZATION) {
@@ -1469,6 +1477,7 @@ void clip_draw_main(const bContext *C, SpaceClip *sc, ARegion *ar)
        }
 
        if (width && height) {
+               draw_stabilization_border(sc, ar, width, height, zoomx, zoomy);
                draw_tracking_tracks(sc, ar, clip, width, height, zoomx, zoomy);
                draw_distortion(sc, ar, clip, width, height, zoomx, zoomy);
        }