Final merge of HEAD (bf-blender) into the orange branch.
[blender.git] / source / blender / src / drawseq.c
index c06108e1e16474245ad0b46e092413594fa9d049..153b304079e98993eb864bece845ab11d25ab515 100644 (file)
@@ -825,16 +825,34 @@ void drawseqspace(ScrArea *sa, void *spacedata)
 
        if(ed) {
                seq= ed->seqbasep->first;
-               while(seq) {
-                       if(seq->flag & SELECT); else drawseq(seq);
+               while(seq) { /* bound box test, dont draw outside the view */
+                       if (seq->flag & SELECT ||
+                                       seq->start > G.v2d->cur.xmax ||
+                                       seq->start+seq->len < G.v2d->cur.xmin ||
+                                       seq->machine+1.0 < G.v2d->cur.ymin ||
+                                       seq->machine > G.v2d->cur.ymax)
+                       {
+                               /* dont draw */
+                       } else {
+                               drawseq(seq);
+                       }
                        seq= seq->next;
                }
        }
        ed= G.scene->ed;
        if(ed) {
                seq= ed->seqbasep->first;
-               while(seq) {
-                       if(seq->flag & SELECT) drawseq(seq);
+               while(seq) { /* bound box test, dont draw outside the view */
+                       if (!(seq->flag & SELECT) ||
+                                       seq->start > G.v2d->cur.xmax ||
+                                       seq->start+seq->len < G.v2d->cur.xmin ||
+                                       seq->machine+1.0 < G.v2d->cur.ymin ||
+                                       seq->machine > G.v2d->cur.ymax)
+                       {
+                               /* dont draw */
+                       } else {
+                               drawseq(seq);
+                       }
                        seq= seq->next;
                }
        }