Commit: 458fcfd4c4986c65805be20d31114cefc7690fcd
Author: Antony Riakiotakis
Date:   Wed Sep 3 16:47:18 2014 +0200
Branches: terrible_consequencer
https://developer.blender.org/rB458fcfd4c4986c65805be20d31114cefc7690fcd

Minor corrections:

* Add some comments to better describe what some numbers mean
* Fix cuddliness and parent position of strips

===================================================================

M       source/blender/editors/space_sequencer/sequencer_draw.c
M       source/blender/makesdna/DNA_sequence_types.h

===================================================================

diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c 
b/source/blender/editors/space_sequencer/sequencer_draw.c
index aa8dc67..bc251a4 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -632,7 +632,7 @@ const static unsigned short strip_element_buffer[] = {9, 
10, 8, 11, 7, 12, 6, 13
 
 static float calculate_cuddly_radius_x(float x1, float x2, float h, float 
aspect)
 {
-       return 0.5f * min_ff(h * 0.25f / aspect, (x2 - x1));    
+       return 0.25f * min_ff(h * 0.25f / aspect, (x2 - x1));   
 }
 
 static void generate_strip_vertices(float x1, float y1, float x2, float y2, 
float aspect)
@@ -937,14 +937,16 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, 
Sequence *seq, int outline
        if (seq->parent && seq->parent->machine != seq->machine) {
                Sequence *parent = seq->parent;
                float x1_par, x2_par, xpar;
-               float ypar, yseq;
-               x1_par = (parent->startstill) ? parent->start : 
parent->startdisp;
-               x2_par = (parent->endstill) ? (parent->start + parent->len) : 
parent->enddisp;
+               float ypar, yseq, cuddly_par;
+               x1_par = parent->startdisp;
+               x2_par = parent->enddisp;
                y1 = seq->machine + SEQ_STRIP_OFSBOTTOM;
                y2 = seq->machine + SEQ_STRIP_OFSTOP;
                
-               xpar = max_ff(x1_par + calculate_cuddly_radius_x(x1_par, 
x2_par, SEQ_STRIP_OFSTOP - SEQ_STRIP_OFSBOTTOM, aspect), xchild);
-               xpar = min_ff(x2_par, xpar);
+               cuddly_par = calculate_cuddly_radius_x(x1_par, x2_par, 
SEQ_STRIP_OFSTOP - SEQ_STRIP_OFSBOTTOM, aspect);
+               
+               xpar = max_ff(x1_par + cuddly_par, xchild);
+               xpar = min_ff(x2_par - cuddly_par, xpar);
 
                if (seq->machine > parent->machine) {
                        yseq = seq->machine + SEQ_STRIP_OFSBOTTOM;
diff --git a/source/blender/makesdna/DNA_sequence_types.h 
b/source/blender/makesdna/DNA_sequence_types.h
index 44cbd89..39626c1 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -131,10 +131,10 @@ typedef struct Sequence {
 
        int flag, type; /*flags bitmap (see below) and the type of sequence*/
        int len; /* the length of the contents of this strip - before handles 
are applied */
-       int start, startofs, endofs;
+       int start, startofs, endofs; /* start, start frame of contents of strip 
*/
        int startstill, endstill;
        int machine, depth; /*machine - the strip channel, depth - the depth in 
the sequence when dealing with metastrips */
-       int startdisp, enddisp; /*starting and ending points in the sequence*/
+       int startdisp, enddisp; /* starting and ending points of the strip in 
the sequence*/
        float sat;
        float mul, handsize;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to