Revision: 3345
          http://vexi.svn.sourceforge.net/vexi/?rev=3345&view=rev
Author:   clrg
Date:     2009-01-08 02:40:15 +0000 (Thu, 08 Jan 2009)

Log Message:
-----------
Make layout consistent
- place clips all content (previously was constraining to texture/text)
- layer and pack constrain content (same as before)
- fix probable issue; HAS_WIDTH_SLACK not set when texture larger than 
constrained children

Modified Paths:
--------------
    trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp

Modified: trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp  2009-01-08 02:34:35 UTC 
(rev 3344)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp  2009-01-08 02:40:15 UTC 
(rev 3345)
@@ -192,7 +192,7 @@
 
     private Box parent = null;
     private Box redirect = this;
-    private int flags = DISPLAY | REFLOW | ORIENT | TILE_IMAGE | PACK | CLIP | 
PLACE_CLEAN;
+    private int flags = DISPLAY | REFLOW | ORIENT | TILE_IMAGE | PACK | 
PLACE_CLEAN;
     private short trapflags = 0;
     private BasicTree bt = null;
     // rendering properties
@@ -427,13 +427,19 @@
         //if (lock) clear(LOCK_CHILDREN);
         
         //#repeat width/height WIDTH/HEIGHT
-        if (newwidth < minwidth || newwidth < text.width)
-            set(HAS_WIDTH_SLACK);
-        else clear(HAS_WIDTH_SLACK);
-        // constrain contentwidth
-        if (texture != null)
-            newwidth = max(newwidth, texture.width);
-        newwidth = max(newwidth, text.width);
+        if (test(CLIP)) {
+            if (newwidth < minwidth)
+                set(HAS_WIDTH_SLACK);
+            else clear(HAS_WIDTH_SLACK);
+        } else {
+            if (newwidth < minwidth || newwidth < text.width || (texture!=null 
&& newwidth < texture.width))
+                set(HAS_WIDTH_SLACK);
+            else clear(HAS_WIDTH_SLACK);
+            // constrain contentwidth
+            if (texture != null)
+                newwidth = max(newwidth, texture.width);
+            newwidth = max(newwidth, text.width);
+        }
         newwidth = min(maxwidth, max(minwidth, newwidth));
 
         // mark 
@@ -1382,16 +1388,15 @@
             if (JSU.toString(value).equals("place")) {
                 if (test(PACK) || !test(CLIP)) { 
                     clear(PACK); set(CLIP);
-                }
-                else return;
+                } else return;
             } else if (JSU.toString(value).equals("layer")) {
                 if (test(PACK) || test(CLIP)) { 
                     clear(PACK); clear(CLIP);
-                }
-                else return;
+                } else return;
             }  else if (JSU.toString(value).equals("pack")) {
                 if (test(PACK)) return;
-                else set(PACK);
+                set(PACK);
+                clear(CLIP);
             } else throw new JSExn("Attempt to set Box property 'layout' to 
unsupported value '"+JSU.toString(value)+"'");
             setConstrain();
             setPlace();


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

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to