Revision: 2296
http://vexi.svn.sourceforge.net/vexi/?rev=2296&view=rev
Author: clrg
Date: 2007-09-21 10:40:50 -0700 (Fri, 21 Sep 2007)
Log Message:
-----------
Change the way we handle Box textures:
- put to contentwidth/contentheight instead of minwidth/minheight
- means we move the trap handling to reflow
- unanticipated benefit of this is it is a major optimization
- no more incremental layout
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 2007-09-21 00:52:49 UTC
(rev 2295)
+++ trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp 2007-09-21 17:40:50 UTC
(rev 2296)
@@ -304,9 +304,14 @@
Log.debug(Box.class, "Called run() on a Box with a null texture");
} else if (texture.isLoaded) {
if (test(TILE_IMAGE)) {
- putAndTriggerTraps(SC_minwidth, JSU.N(texture.width));
- putAndTriggerTraps(SC_minheight, JSU.N(texture.height));
+ // the texture affects contentsize but that's irrelevant if the
+ // box is already allocated a bigger space than the the texture
+ if (texture.width > width || texture.height > height) {
+ setConstrain();
+ return null;
+ }
}
+ // in which case we just need to 'paint' our texture
dirty();
} else if (texture.loadFailed) {
JS res = texture.stream;
@@ -439,7 +444,11 @@
set(HAS_WIDTH_SLACK);
else clear(HAS_WIDTH_SLACK);
// constrain contentwidth
- newwidth = min(maxwidth, max(minwidth, max(newwidth, text.width)));
+ if (!test(HAS_EMPTY_STRING))
+ newwidth = max(newwidth, text.width);
+ if (texture != null)
+ newwidth = max(newwidth, texture.width);
+ newwidth = min(maxwidth, max(minwidth, newwidth));
// mark
if (newwidth != contentwidth) {
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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn