# HG changeset patch # User Jordan Miner # Date 1248928061 18000 # Node ID 04d2867d335cd99fb7308304e1e2f5cb3202d456 # Parent 69df5369c5f770dc4c4dad9d2757bec903d23f68 Fix possible incorrect extra space after the last control in a layout. diff -r 69df5369c5f7 -r 04d2867d335c dynamin/gui/layout.d --- a/dynamin/gui/layout.d Wed Jul 29 23:25:29 2009 -0500 +++ b/dynamin/gui/layout.d Wed Jul 29 23:27:41 2009 -0500 @@ -273,6 +273,7 @@ real max = 0; LayoutGroup* l; + bool prevNonFiller = false; int sp = 0; for(int col = 0; col < numColumns; ++col) { // go down each column for(int row = 0; row < numRows; ++row) { @@ -288,11 +289,14 @@ info.elasticWidth += max; else if(colsInfo[col].elastic == Elasticity.Semi) info.semiColumns++; + // this won't add spacing to the first non-filler + sp = (!colsInfo[col].filler && prevNonFiller) ? spacing : 0; info.bestSize.width = info.bestSize.width + sp + max; - sp = (colsInfo[col].filler ? 0 : spacing); + prevNonFiller = !colsInfo[col].filler ? true : prevNonFiller ; max = 0; } + prevNonFiller = false; real maxBl = 0; sp = 0; for(int row = 0; row < numRows; ++row) { // go over each row @@ -311,8 +315,10 @@ info.elasticHeight += max; else if(rowsInfo[row].elastic == Elasticity.Semi) info.semiRows++; + // this won't add spacing to the first non-filler + sp = (!rowsInfo[row].filler && prevNonFiller) ? spacing : 0; info.bestSize.height = info.bestSize.height + sp + max; - sp = (rowsInfo[row].filler ? 0 : spacing); + prevNonFiller = !rowsInfo[row].filler ? true : prevNonFiller ; max = maxBl = 0; } }