Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2006-06-22 11:06:42 +0400
committerMatt Ebb <matt@mke3.net>2006-06-22 11:06:42 +0400
commit973ffe5319ec0e5c19933ac509835a1ddfdabe9d (patch)
treec69ede2fc27b8d0d1d720a2d159b284dda9b07f7 /source/blender/src/editseq.c
parent193015653f5210d3ca7e10326fade2fb9fd465af (diff)
* Two sequence editor fixes, found by Peter
- strip handle selection now properly uses the new clamped handle size, instead of the old triangles - fixed an issue where a strip resized inwards would disappear when the original start < window edge < resized start, and vice versa
Diffstat (limited to 'source/blender/src/editseq.c')
-rw-r--r--source/blender/src/editseq.c49
1 files changed, 19 insertions, 30 deletions
diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c
index f31d20aea00..2360c7443b5 100644
--- a/source/blender/src/editseq.c
+++ b/source/blender/src/editseq.c
@@ -176,53 +176,42 @@ Sequence *find_nearest_seq(int *hand)
{
Sequence *seq;
Editing *ed;
- float x, y, facx, facy;
+ float x, y;
short mval[2];
-
+ float pixelx;
+ float handsize;
+ float minhandle, maxhandle;
+ View2D *v2d = G.v2d;
*hand= 0;
ed= G.scene->ed;
if(ed==0) return 0;
+
+ pixelx = (v2d->cur.xmax - v2d->cur.xmin)/(v2d->mask.xmax - v2d->mask.xmin);
getmouseco_areawin(mval);
areamouseco_to_ipoco(G.v2d, mval, &x, &y);
-
+
seq= ed->seqbasep->first;
+
while(seq) {
+ /* clamp handles to defined size in pixel space */
+ handsize = seq->handsize;
+ minhandle = 7;
+ maxhandle = 28;
+ CLAMP(handsize, minhandle*pixelx, maxhandle*pixelx);
+
if(seq->machine == (int)y) {
/* check for both normal strips, and strips that have been flipped horizontally */
if( ((seq->startdisp < seq->enddisp) && (seq->startdisp<=x && seq->enddisp>=x)) ||
((seq->startdisp > seq->enddisp) && (seq->startdisp>=x && seq->enddisp<=x)) )
{
-
if(seq->type < SEQ_EFFECT) {
- if( seq->handsize+seq->startdisp >=x ) {
- /* within triangle? */
- facx= (x-seq->startdisp)/seq->handsize;
- if( (y - (int)y) <0.5) {
- facy= (y - 0.2 - (int)y)/0.3;
- if( facx < facy ) *hand= 1;
- }
- else {
- facy= (y - 0.5 - (int)y)/0.3;
- if( facx+facy < 1.0 ) *hand= 1;
- }
-
- }
- else if( -seq->handsize+seq->enddisp <=x ) {
- /* within triangle? */
- facx= 1.0 - (seq->enddisp-x)/seq->handsize;
- if( (y - (int)y) <0.5) {
- facy= (y - 0.2 - (int)y)/0.3;
- if( facx+facy > 1.0 ) *hand= 2;
- }
- else {
- facy= (y - 0.5 - (int)y)/0.3;
- if( facx > facy ) *hand= 2;
- }
- }
+ if( handsize+seq->startdisp >=x )
+ *hand= 1;
+ else if( -handsize+seq->enddisp <=x )
+ *hand= 2;
}
-
return seq;
}
}