summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2008-09-19 18:03:15 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2008-09-19 18:03:15 +0000
commit06afb4e37ef45a7ff6922e7c5b7e21a2e811ce44 (patch)
treeb70d8c32b6746c5bc233d905b5cde1bf312e2f6f /src
parentChange function arg from NR::Matrix to Geom::Matrix. Possible serious bug. (diff)
downloadinkscape-06afb4e37ef45a7ff6922e7c5b7e21a2e811ce44.tar.gz
inkscape-06afb4e37ef45a7ff6922e7c5b7e21a2e811ce44.zip
by default, try square arrangement, not 1 row as before
(bzr r6847)
Diffstat (limited to 'src')
-rw-r--r--src/dialogs/tiledialog.cpp13
1 files changed, 8 insertions, 5 deletions
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);