Revision: 3499
          http://vexi.svn.sourceforge.net/vexi/?rev=3499&view=rev
Author:   clrg
Date:     2009-05-18 15:15:55 +0000 (Mon, 18 May 2009)

Log Message:
-----------
Fix Surface handling of frame x/y

Modified Paths:
--------------
    trunk/core/org.vexi.core/src/org/vexi/core/Surface.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-05-18 
13:24:47 UTC (rev 3498)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Surface.java     2009-05-18 
15:15:55 UTC (rev 3499)
@@ -352,17 +352,26 @@
     private final Callable poschanger = new Callable() {
         public Object run(Object o) throws JSExn {
             poschangeScheduled = false;
-            Rectangle s = Platform.getScreenBounds();;
-            // horizontal
-            int rootx = leftAlign ? x :
-                x - s.width + leftInset + rightInset + root.maxwidth;
-            rootx -= s.x;
-            if (!rightAlign) rootx = rootx / 2;
-            // vertical
-            int rooty = topAlign ? y :
-                y - s.height + leftInset + rightInset + root.maxheight;
-            rooty -= s.y;
-            if (!bottomAlign) rooty = rooty / 2;
+            Rectangle s = Platform.getScreenBounds();
+            
+            // left aligned
+            int rootx = x - s.x;
+            // right aligned
+            if (!leftAlign && rightAlign)
+                rootx = s.width - (rootx + leftInset + rightInset + 
root.width);
+            // center aligned
+            if (!leftAlign && !rightAlign)
+                rootx = rootx - (s.width - (root.width + leftInset + 
rightInset)) / 2;
+                
+            // top aligned
+            int rooty = y - s.y;
+            // bottom aligned
+            if (!topAlign && bottomAlign)
+                rooty = s.height - (rooty + topInset + bottomInset + 
root.height);
+            // center aligned
+            if (!topAlign && !bottomAlign)
+                rooty = rooty - (s.height - (root.height + topInset + 
bottomInset)) / 2;
+            
             root.setRootPosition(rootx, rooty);
             return o;
         }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to