summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 34f1fc8)
raw | patch | inline | side by side (parent: 34f1fc8)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 19 Sep 2008 18:03:15 +0000 (18:03 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 19 Sep 2008 18:03:15 +0000 (18:03 +0000) |
src/dialogs/tiledialog.cpp | patch | blob | history |
index e1287f0516ee2f3378225357274043002aa86472..99919d127f9822bde8b873d2d020172f2d6bb14d 100644 (file)
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);
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);
}
/*#### 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);