svn merge ^/trunk/blender -r49167:49175
authorCampbell Barton <ideasman42@gmail.com>
Tue, 24 Jul 2012 12:38:37 +0000 (12:38 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 24 Jul 2012 12:38:37 +0000 (12:38 +0000)
1  2 
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/makesdna/DNA_node_types.h

index 285c51a7d62ca8cc365a35f3152215e45c626248,09bfa384db0690979ec2177141147a683805725a..e240b2d08068a9c9a3afff63e5ec81359c529192
@@@ -1009,58 -1047,9 +1064,11 @@@ void draw_image_seq(const bContext *C, 
  
        //if (sc->mode == SC_MODE_MASKEDIT) {
        if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) {
-               Sequence *seq_act = BKE_sequencer_active_get(scene);
-               if (seq_act && seq_act->type == SEQ_TYPE_MASK && seq_act->mask) {
-                       int x, y;
-                       int width, height;
-                       float zoomx, zoomy;
-                       /* frame image */
-                       float maxdim;
-                       float xofs, yofs;
-                       /* find window pixel coordinates of origin */
-                       UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x, &y);
-                       width = v2d->tot.xmax - v2d->tot.xmin;
-                       height = v2d->tot.ymax - v2d->tot.ymin;
-                       zoomx = (float)(ar->winrct.xmax - ar->winrct.xmin + 1) / (float)((ar->v2d.cur.xmax - ar->v2d.cur.xmin));
-                       zoomy = (float)(ar->winrct.ymax - ar->winrct.ymin + 1) / (float)((ar->v2d.cur.ymax - ar->v2d.cur.ymin));
-                       x += v2d->tot.xmin * zoomx;
-                       y += v2d->tot.ymin * zoomy;
-                       /* frame the image */
-                       maxdim = maxf(width, height);
-                       if (width == height) {
-                               xofs = yofs = 0;
-                       }
-                       else if (width < height) {
-                               xofs = ((height - width) / -2.0f) * zoomx;
-                               yofs = 0.0f;
-                       }
-                       else { /* (width > height) */
-                               xofs = 0.0f;
-                               yofs = ((width - height) / -2.0f) * zoomy;
-                       }
-                       /* apply transformation so mask editing tools will assume drawing from the origin in normalized space */
-                       glPushMatrix();
-                       glTranslatef(x + xofs, y + yofs, 0);
-                       glScalef(maxdim * zoomx, maxdim * zoomy, 0);
-                       ED_mask_draw((bContext *)C, 0, 0); // sc->mask_draw_flag, sc->mask_draw_type
-                       ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
-                       glPopMatrix();
-               }
+               sequencer_main_area_draw_mask(C, scene, ar);
        }
  
 +      if (cache_handle)
 +              IMB_display_buffer_release(cache_handle);
  }
  
  #if 0