canvas::grid : compute all row/col extents
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 1 Feb 2017 19:35:52 +0000 (20:35 +0100)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 1 Feb 2017 20:58:20 +0000 (21:58 +0100)
libs/canvas/grid.cc

index 15d57b4886a5a61b1bde77fdb0e32f6e7da5c6e6..e5d05e9f05ef872c070dd46dd11d78d29305e3f5 100644 (file)
@@ -184,13 +184,13 @@ Grid::reposition_children ()
        uint32_t max_col = 0;
 
        /* since we encourage dynamic and essentially random placement of
-        * children, begin by determining the maximum row and column given
+        * children, begin by determining the maximum row and column extents given
         * our current set of children and placements.
         */
 
        for (CoordsByItem::const_iterator c = coords_by_item.begin(); c != coords_by_item.end(); ++c) {
-               max_col = max (max_col, (uint32_t) c->second.x);
-               max_row = max (max_row, (uint32_t) c->second.y);
+               max_col = max (max_col, (uint32_t) (c->second.x + c->second.col_span));
+               max_row = max (max_row, (uint32_t) (c->second.y + c->second.row_span));
        }
 
        max_row++;