Revision: 3921
          http://vexi.svn.sourceforge.net/vexi/?rev=3921&view=rev
Author:   clrg
Date:     2010-10-18 20:08:43 +0000 (Mon, 18 Oct 2010)

Log Message:
-----------
Fix some reflow issues that resulted in the symptom of messy tooltips

Modified Paths:
--------------
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/block.t
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/edit.t

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/block.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/block.t        
2010-10-18 18:03:17 UTC (rev 3920)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/block.t        
2010-10-18 20:08:43 UTC (rev 3921)
@@ -93,6 +93,7 @@
     /** synchronizes the block and it's contents with it's current size */
     static.reflowBlock = function(b) {
         if (b.multiline and b.width == 0 and b.wrapwidth == 0) {
+            // initial state of a block, wait for valid parameters
             return;
         }
         
@@ -235,7 +236,9 @@
     static.propagateOnWrite = function(v) {
         cascade = v;
         var n = trapee.numchildren;
-        for (var i=0; n>i; i++) trapee[i][trapname] = v;
+        for (var i=0; n>i; i++) {
+            trapee[i][trapname] = v;
+        }
     }
     
     /** trap: set whether this is a flowing (multiline) text block or not 
(singleline) */
@@ -369,14 +372,15 @@
     
     /** reset block dimensions if wrapwidth is unset */
     static.wrapwidthWrite = function(v) {
+        cascade = v;
         if (v) {
             trapee.width --= static.invokeReflow;
+            static.reflowBlock(trapee);
         } else {
             trapee.minwidth = 0;
             trapee.maxwidth = vexi.ui.maxdim;
             trapee.width ++= static.invokeReflow;
         }
-        cascade = v;
     }
     
 </vexi>

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/edit.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/edit.t 2010-10-18 
18:03:17 UTC (rev 3920)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/text/edit.t 2010-10-18 
20:08:43 UTC (rev 3921)
@@ -499,6 +499,7 @@
         var insertText = function(t) {
             if (select) deleteSelectedText();
             if (t == "" or !t) return;
+            if (vexi.debug) vexi.trace(t);
             
             // split t into an array of text blocks
             var blocks = static.getBlocksFromString(t);
@@ -855,6 +856,9 @@
             cascade = v;
             // the index of cWord in cBlock
             cwInd = cWord ? cBlock.indexof(cWord) : null;
+            if (vexi.debug) {
+                vexi.trace(v);
+            }
             
             // character insertion
             if (v.length == 1) {
@@ -1372,7 +1376,8 @@
                         }
                         thisbox[cbInd+1] = nblock;
                         cBlock.reflow = true;
-                        nblock.reflow = true;
+                        // cBlock.reflow called at the end of KeyPressed
+                        // so no need to reflow nblock(cBlock) manually
                         cBlock = nblock;
                         cWord = cBlock.numchildren ? cBlock[0] : null;
                         cPos = 0;


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

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to