From: buliabyak Date: Fri, 19 Sep 2008 18:03:15 +0000 (+0000) Subject: by default, try square arrangement, not 1 row as before X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=06ebe04471448f69d3eaa24f6acdf958ff42b761;p=inkscape.git by default, try square arrangement, not 1 row as before --- diff --git a/src/dialogs/tiledialog.cpp b/src/dialogs/tiledialog.cpp index e1287f051..99919d127 100644 --- a/src/dialogs/tiledialog.cpp +++ b/src/dialogs/tiledialog.cpp @@ -569,7 +569,7 @@ void TileDialog::updateSelection() const GSList *items = selection->itemList(); int selcount = g_slist_length((GSList *)items); - if (NoOfColsSpinner.get_value()>1){ + if (NoOfColsSpinner.get_value()>1 && NoOfRowsSpinner.get_value()>1){ // Update the number of rows assuming number of columns wanted remains same. double NoOfRows = ceil(selcount / NoOfColsSpinner.get_value()); NoOfRowsSpinner.set_value(NoOfRows); @@ -581,8 +581,11 @@ void TileDialog::updateSelection() prefs_set_double_attribute ("dialogs.gridtiler", "NoOfCols", NoOfCols); } } else { - NoOfColsSpinner.set_value(selcount); - prefs_set_double_attribute ("dialogs.gridtiler", "NoOfCols", selcount); + double PerRow = ceil(sqrt(selcount)); + double PerCol = ceil(sqrt(selcount)); + NoOfRowsSpinner.set_value(PerRow); + NoOfColsSpinner.set_value(PerCol); + prefs_set_double_attribute ("dialogs.gridtiler", "NoOfCols", PerCol); } @@ -643,8 +646,8 @@ TileDialog::TileDialog() /*#### Number of Rows ####*/ - double PerRow = selcount; - double PerCol = 1; + double PerRow = ceil(sqrt(selcount)); + double PerCol = ceil(sqrt(selcount)); #ifdef DEBUG_GRID_ARRANGE g_print("/n PerRox = %f PerCol = %f selcount = %d",PerRow,PerCol,selcount);