Revision: 1938
http://svn.sourceforge.net/vexi/?rev=1938&view=rev
Author: clrg
Date: 2007-07-07 08:45:48 -0700 (Sat, 07 Jul 2007)
Log Message:
-----------
Fix math glitch when calculating box under mouse cursor for events
Modified Paths:
--------------
core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp
Modified: core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp
===================================================================
--- core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp 2007-07-07 15:32:19 UTC
(rev 1937)
+++ core/trunk/org.vexi.core/src/org/vexi/core/Box.jpp 2007-07-07 15:45:48 UTC
(rev 1938)
@@ -671,7 +671,7 @@
int i = 0;
for (Box b = getChild(0); b != null; b = getChild(++i)) {
if (!b.test(DISPLAY)) continue;
- if (globalx + b.x > cx2) break;
+ if (globalx + b.x >= cx2) break;
if (globalx + b.x + b.width < cx1) continue;
b.render(globalx, globaly, cx1, cy1, cx2, cy2, buf);
}
@@ -679,7 +679,7 @@
int i = 0;
for (Box b = getChild(0); b != null; b = getChild(++i)) {
if (!b.test(DISPLAY)) continue;
- if (globaly + b.y > cy2) break;
+ if (globaly + b.y >= cy2) break;
if (globaly + b.y + b.height < cy1) continue;
b.render(globalx, globaly, cx1, cy1, cx2, cy2, buf);
}
@@ -946,8 +946,8 @@
for (Box b = getChild(i); b != null; b = getChild(--i)) {
if (!b.test(DISPLAY)) continue;
bx = b.getXInParent(); by = b.getYInParent();
- if ((mousex > bx) && (mousex <= bx + b.width))
- if ((mousey > by) && (mousey <= by + b.height))
+ if ((mousex >= bx) && (mousex < bx + b.width))
+ if ((mousey >= by) && (mousey < by + b.height))
if (!b.propagateMoveAndEnter(mousex - bx, mousey - by))
return false;
}
@@ -957,8 +957,8 @@
int i = 0;
for (Box b = getChild(0); b != null; b = getChild(++i)) {
if (!b.test(DISPLAY)) continue;
- if (mousex > b.x + b.width) continue;
- if ((mousex > b.x) && (mousex <= b.x + b.width) && (mousey >
b.y) && (mousey <= b.y + b.height))
+ if (mousex >= b.x + b.width) continue;
+ if ((mousex >= b.x) && (mousex < b.x + b.width) && (mousey >=
b.y) && (mousey < b.y + b.height))
if (!b.propagateMoveAndEnter(mousex - b.x, mousey - b.y))
return false;
break;
@@ -969,8 +969,8 @@
int i = 0;
for (Box b = getChild(0); b != null; b = getChild(++i)) {
if (!b.test(DISPLAY)) continue;
- if (mousey > b.y + b.height) continue;
- if ((mousey > b.y) && (mousey <= b.y + b.height) && (mousex >
b.x) && (mousex <= b.x + b.width))
+ if (mousey >= b.y + b.height) continue;
+ if ((mousey >= b.y) && (mousey < b.y + b.height) && (mousex >=
b.x) && (mousex < b.x + b.width))
if (!b.propagateMoveAndEnter(mousex - b.x, mousey - b.y))
return false;
break;
@@ -1008,8 +1008,8 @@
for (Box b = getChild(i); b != null; b = getChild(--i)) {
if (!b.test(DISPLAY)) continue;
bx = b.getXInParent(); by = b.getYInParent();
- if ((mousex > bx) && (mousex <= bx + b.width))
- if ((mousey > by) && (mousey <= by + b.height))
+ if ((mousex >= bx) && (mousex < bx + b.width))
+ if ((mousey >= by) && (mousey < by + b.height))
if (!b.propagateEvent(event, value, mousex - bx,
mousey - by))
return false;
}
@@ -1019,8 +1019,8 @@
int i = 0;
for (Box b = getChild(0); b != null; b = getChild(++i)) {
if (!b.test(DISPLAY)) continue;
- if (mousex > b.x + b.width) continue;
- if ((mousex > b.x) && (mousex <= b.x + b.width) && (mousey >
b.y) && (mousey <= b.y + b.height))
+ if (mousex >= b.x + b.width) continue;
+ if ((mousex >= b.x) && (mousex < b.x + b.width) && (mousey >=
b.y) && (mousey < b.y + b.height))
if (!b.propagateEvent(event, value, mousex - b.x, mousey -
b.y))
return false;
break;
@@ -1031,8 +1031,8 @@
int i = 0;
for (Box b = getChild(0); b != null; b = getChild(++i)) {
if (!b.test(DISPLAY)) continue;
- if (mousey > b.y + b.height) continue;
- if ((mousey > b.y) && (mousey <= b.y + b.height) && (mousex >
b.x) && (mousex <= b.x + b.width))
+ if (mousey >= b.y + b.height) continue;
+ if ((mousey >= b.y) && (mousey < b.y + b.height) && (mousex >=
b.x) && (mousex < b.x + b.width))
if (!b.propagateEvent(event, value, mousex - b.x, mousey -
b.y))
return false;
break;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn