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:
authorCampbell Barton <ideasman42@gmail.com>2007-10-28 19:00:23 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-10-28 19:00:23 +0300
commit47da2813d81b948e9e175e7c01ebaa794db395e1 (patch)
treefdd9dacbc1054db1437b4b3d820b6f9240115ce7 /source/blender/src/editseq.c
parent04be929b882a6df1bb2db011a067079dbef0570a (diff)
sequencer strip selection didnt work well for verry thin strips.
Improved the logic that deciedes when to select handles.
Diffstat (limited to 'source/blender/src/editseq.c')
-rw-r--r--source/blender/src/editseq.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c
index 88705404965..ee13107eeb2 100644
--- a/source/blender/src/editseq.c
+++ b/source/blender/src/editseq.c
@@ -398,7 +398,7 @@ Sequence *find_nearest_seq(int *hand)
short mval[2];
float pixelx;
float handsize;
- float minhandle, maxhandle;
+ float displen;
View2D *v2d = G.v2d;
*hand= 0;
@@ -413,22 +413,31 @@ Sequence *find_nearest_seq(int *hand)
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(sequence_is_free_transformable(seq)) {
- if( handsize+seq->startdisp >=x )
- *hand= 1;
- else if( -handsize+seq->enddisp <=x )
- *hand= 2;
+
+ /* clamp handles to defined size in pixel space */
+
+ handsize = seq->handsize;
+ displen = (float)abs(seq->startdisp - seq->enddisp);
+
+ if (displen/pixelx > 10) { /* dont even try to grab the handles of small strips */
+ CLAMP( handsize,
+ 7*pixelx,
+ /* Set the max value to handle to 1/3 of the total len when its less then 28.
+ * This is important because otherwise selecting handles happens even when you click in the middle */
+ (int) MIN2(28*3, ((float)displen) /3)*pixelx
+ );
+
+ if( handsize+seq->startdisp >=x )
+ *hand= 1;
+ else if( -handsize+seq->enddisp <=x )
+ *hand= 2;
+ }
}
return seq;
}