Revision: 2455 http://vexi.svn.sourceforge.net/vexi/?rev=2455&view=rev Author: clrg Date: 2007-10-14 10:53:10 -0700 (Sun, 14 Oct 2007)
Log Message: ----------- Refactor the reflow() invocation functions so that forcereflow() works on unsized boxes Modified Paths: -------------- trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp trunk/core/org.vexi.core/src/org/vexi/core/Surface.java Modified: trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp =================================================================== --- trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp 2007-10-14 16:18:25 UTC (rev 2454) +++ trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp 2007-10-14 17:53:10 UTC (rev 2455) @@ -387,17 +387,20 @@ setPlaceInTree(); } - /** should only be invoked on the root box */ + /** used to invoke reflow on a box and it's children */ public void reflow() { if ((flags & REFLOW) == 0) return; - reflow(width, height); + constrain(); + int w = test(HSHRINK) ? contentwidth : maxwidth; + int h = test(VSHRINK) ? contentheight : maxheight; + tryResize(w, h); + place(); } /** should only be invoked on the root box */ public void reflow(int w, int h) { + if ((flags & REFLOW) == 0) return; constrain(); - //tryResize(test(HSHRINK) ? contentwidth : maxwidth, - // test(VSHRINK) ? contentheight : maxheight); tryResize(w, h); place(); } Modified: trunk/core/org.vexi.core/src/org/vexi/core/Surface.java =================================================================== --- trunk/core/org.vexi.core/src/org/vexi/core/Surface.java 2007-10-14 16:18:25 UTC (rev 2454) +++ trunk/core/org.vexi.core/src/org/vexi/core/Surface.java 2007-10-14 17:53:10 UTC (rev 2455) @@ -389,7 +389,7 @@ // unused - private static Affine identity = Affine.identity(); - /** runs the prerender() and render() pipelines in the root Box to regenerate the backbuffer, then blits it to the screen */ + /** runs the pre-render() and render() pipelines in the root Box to regenerate the backbuffer, then blits it to the screen */ public synchronized void render() { scheduled = false; firstrender = false; @@ -406,10 +406,9 @@ dirty(0, root.height - scarImage.height, scarImage.width, scarImage.height); dirty(0, root.height - scarImage.height, scarImage.width, scarImage.height); } - // reflow to new size as set by the frame - root.reflow(pendingWidth, pendingHeight); - // size the same but maybe box-tree needs reflow - } else root.reflow(); + } + // reflow to new size as set by the frame + root.reflow(pendingWidth, pendingHeight); } while(abort); int numregions = dirtyRegions.num(); 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: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn