Page MenuHome

toolboxpatch.diff

toolboxpatch.diff

Index: source/blender/src/interface.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/interface.c,v
retrieving revision 1.217
diff -u -r1.217 interface.c
--- source/blender/src/interface.c 20 Nov 2005 23:06:52 -0000 1.217
+++ source/blender/src/interface.c 2 Dec 2005 19:31:33 -0000
@@ -3481,8 +3481,8 @@
*/
static int ui_mouse_motion_towards_block(uiBlock *block, uiEvent *uevent)
{
- short mvalo[2], dx, dy, domx, domy;
- int counter=0;
+ short mvalo[2], dx, dy, domx, domy, lastx, lasty;
+ int counter=0, mousehasstopped=0;
if((block->direction & UI_TOP) || (block->direction & UI_DOWN)) return 0;
if(uevent->event!= MOUSEX && uevent->event!= MOUSEY) return 0;
@@ -3494,10 +3494,26 @@
if( abs(domx)<4 ) return 0;
uiGetMouse(mywinget(), mvalo);
+ lastx=mvalo[0];
+ lasty=mvalo[1];
while(TRUE) {
+ /* idle for this poor code */
+ PIL_sleep_ms(10);
+ counter++;
+ if(counter > 100) {
+ // printf("left because of timer (1 sec)\n");
+ return 0;
+ }
+
uiGetMouse(mywinget(), uevent->mval);
+ if ( (uevent->mval[0]==lastx) && (uevent->mval[1]==lasty) ) {
+ if (mousehasstopped > 10) return 0; // mouse has stopped for 100 ms
+ mousehasstopped++;
+ }
+ else mousehasstopped=0;
+
/* check inside, if so return */
if( block->minx <= uevent->mval[0] && block->maxx >= uevent->mval[0] ) {
if( block->miny <= uevent->mval[1] && block->maxy >= uevent->mval[1] ) {
@@ -3537,14 +3553,8 @@
return 0;
}
}
- }
-
- /* idle for this poor code */
- PIL_sleep_ms(10);
- counter++;
- if(counter > 100) {
- //printf("left because of timer (1 sec)\n");
- return 0;
+ lastx=uevent->mval[0];
+ lasty=uevent->mval[1];
}
}
@@ -4089,7 +4099,7 @@
else if( BLI_in_rctf(&tblock->safety, (float)uevent->mval[0], (float)uevent->mval[1]))
break;
}
- }
+ }
/* strict check, and include the parent rect */
if(tblock);
else if( BLI_in_rctf(&block->parentrct, (float)uevent->mval[0], (float)uevent->mval[1]));

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9b/93/3edf45b5ac72e762380dec83188f

Event Timeline