Revision: 4607
          http://sourceforge.net/p/vexi/code/4607
Author:   clrg
Date:     2013-11-29 16:03:37 +0000 (Fri, 29 Nov 2013)
Log Message:
-----------
Fix frontierMin/Max confusion

Modified Paths:
--------------
    branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/layout/grid.t

Modified: 
branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/layout/grid.t
===================================================================
--- branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/layout/grid.t    
2013-11-29 15:11:45 UTC (rev 4606)
+++ branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/lib/layout/grid.t    
2013-11-29 16:03:37 UTC (rev 4607)
@@ -37,10 +37,11 @@
                                 return;
                             }
                         }
+                        // same frontier, new region
                         list[i] = newRegion(box, origin, frontier);
                         return;
                     }
-                    // reached the end
+                    // reached the end (or beginning)
                     list[0] = newRegion(box, origin, frontier);
                 };
                 
@@ -69,10 +70,10 @@
         const byCol = {};
         const byRow = {};
         
-        const placeRegions = function(bySet, fullreach, gridsize, shrink, 
contentdim, mindim, maxdim, dim, pos) {
-            const regions = bySet.regions;
-            const frontiers = bySet.frontiers;
-            const f2i = bySet.frontier2index;
+        const placeRegions = function(axis, fullreach, gridsize, shrink, 
contentdim, mindim, maxdim, dim, pos) {
+            const regions = axis.regions;
+            const frontiers = axis.frontiers;
+            const f2i = axis.frontier2index;
             
             // PHASE 1: honor min/max sizes for boxes in order of region
             var contentMin = 0;
@@ -113,7 +114,7 @@
             $content[maxdim] = contentMax;
             
             // PHASE 2: place wrapper boxes in accordance with region/frontier 
min/max sizes
-            if (thisbox[shrink] or $content[mindim] > gridsize) {
+            if (thisbox[shrink] or $content[mindim] >= gridsize) {
                 // honor min sizes
                 for (var i,region in regions.list) {
                     const regionPos = region.origin>0 ? 
frontierMin[region.origin] : 0; 
@@ -201,8 +202,8 @@
                     if (totalSize > gridsize) {
                         // too big; adjust down
                         var reachDown = 0;
-                        for (var i,isMin in frontierMin) {
-                            if (isMin) continue;
+                        for (var i,notMin in frontierMin) {
+                            if (!notMin) continue;
                             reachDown += frontiers[i]-(i==0?0:frontiers[i-1]);
                         }
                         if (reachDown == 0) {
@@ -215,8 +216,8 @@
                     } else {
                         // too small; adjust up
                         var reachUp = 0;
-                        for (var i,isMax in frontierMax) {
-                            if (isMax) continue;
+                        for (var i,notMax in frontierMax) {
+                            if (!notMax) continue;
                             reachUp += frontiers[i]-(i==0?0:frontiers[i-1]);
                         }
                         if (reachUp == 0) {
@@ -503,11 +504,11 @@
             }
         }
         
-        const getIndice = function(bySet) {
+        const getIndice = function(axis) {
             const f2i = {};
-            for (var i,f in bySet.frontiers)
+            for (var i,f in axis.frontiers)
                 f2i[f] = i;
-            bySet.frontier2index = f2i;
+            axis.frontier2index = f2i;
         }
         
         /************************************

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


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to