Revision: 3606
http://vexi.svn.sourceforge.net/vexi/?rev=3606&view=rev
Author: clrg
Date: 2009-08-17 11:50:36 +0000 (Mon, 17 Aug 2009)
Log Message:
-----------
Fix updates to MOUSEINSIDE occuring inbetween Surface.render() and
DoubleBufferedSurface.render() which left dirtyRegions and screenDirtyRegions
inconsistent
Modified Paths:
--------------
trunk/core/org.vexi.core/src/org/vexi/core/Surface.java
trunk/core/org.vexi.core/src/org/vexi/util/DirtyList.java
Modified: trunk/core/org.vexi.core/src/org/vexi/core/Surface.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Surface.java 2009-08-17
08:53:35 UTC (rev 3605)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Surface.java 2009-08-17
11:50:36 UTC (rev 3606)
@@ -73,20 +73,21 @@
// Instance Data
///////////////////////////////////////////////////////////////////////
- public Box root; ///< The Box at the
root of this surface
- public String cursor = "default"; ///< The active cursor
to switch to when syncCursor() is called
- public boolean cursorset = false; ///< Used to prevent
overlapped boxes overwriting the cursor
+ public Box root; ///< the Box at the
root of this surface
+ public String cursor = "default"; ///< the active cursor
to switch to when syncCursor() is called
+ public boolean cursorset = false; ///< used to prevent
overlapped boxes overwriting the cursor
public int x; ///< x position of
surface
public int y; ///< y position of
surface
public int mousex; ///< x position of the
mouse
public int mousey; ///< y position of the
mouse
public int newmousex = -1; ///< x position of the
mouse, in real time; this lets us collapse Move's
public int newmousey = -1; ///< y position of the
mouse, in real time; this lets us collapse Move's
- public boolean minimized = false; ///< True iff this
surface is minimized, in real time
- public boolean maximized = false; ///< True iff this
surface is maximized, in real time
+ public boolean minimized = false; ///< true iff this
surface is minimized, in real time
+ public boolean maximized = false; ///< true iff this
surface is maximized, in real time
protected Picture icon;
private boolean visible = false;
private boolean resizable = false;
+ private boolean mouseUpdateRequired = false; ///< reflow requests
refresh of cursor
final private DirtyList dirtyRegions = new DirtyList(); ///<
Dirty regions on the surface
@@ -468,6 +469,19 @@
makeVisible(visible);
}
if (visible) render();
+
+ // it is possible that the box[es] under the mouse may have changed
+ // so we must re-invoke Move update trigger Enter/Leave/mouseinside
+ if (mouseUpdateRequired) {
+ try {
+ root.tryPropagateMove(mousex, mousey);
+ mouseUpdateRequired = false;
+ } catch (JSExn e) {
+ Log.warn(Box.class,"Caught JS Exception while invoking
tryPropagateMove");
+ e.printStackTrace(Logger.WARN,Log.user);
+ }
+ }
+
return null;
}
@@ -568,8 +582,6 @@
scheduled = false;
// do nothing if we are minimized
if (minimized) return;
- // reflow requests refresh of cursor
- boolean mouseUpdateRequired = false;
// make sure the root is properly sized
do {
abort = false;
@@ -627,17 +639,6 @@
}
}
}
-
- // it is possible that the box[es] under the mouse may have changed
- // so we must re-invoke Move update trigger Enter/Leave/mouseinside
- if (mouseUpdateRequired) {
- try {
- root.tryPropagateMove(mousex, mousey);
- } catch (JSExn e) {
- Log.warn(Box.class,"Caught JS Exception while invoking
tryPropagateMove");
- e.printStackTrace(Logger.WARN,Log.user);
- }
- }
}
Modified: trunk/core/org.vexi.core/src/org/vexi/util/DirtyList.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/util/DirtyList.java 2009-08-17
08:53:35 UTC (rev 3605)
+++ trunk/core/org.vexi.core/src/org/vexi/util/DirtyList.java 2009-08-17
11:50:36 UTC (rev 3606)
@@ -46,7 +46,7 @@
private synchronized void dirty(int x, int y, int w, int h, int ind) {
int _n;
if (w<x || h<y) return;
- for(int i=ind; i<numdirties; i++) {
+ for (int i=ind; i<numdirties; i++) {
_n = 4*i;
if (dirties[_n]<0) continue;
int _x = dirties[_n];
@@ -167,6 +167,7 @@
}
}
+ // region is valid; store it for rendering
_n = numdirties*4;
if (_n == dirties.length) grow();
dirties[_n] = x;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn