[Kst] extragear/graphics/kst/src/libkstapp

George Staikos staikos at kde.org
Wed May 3 22:03:13 CEST 2006


SVN commit 537055 by staikos:

fix the order-by-column code.  I still don't really like it but I guess it
works as well as it can without reworking the plot layouting code yet again.
BUG: 125873


 M  +10 -4     datawizard.ui.h  


--- trunk/extragear/graphics/kst/src/libkstapp/datawizard.ui.h #537054:537055
@@ -730,17 +730,23 @@
     }
 
     // Reorder the vectors if the user wants it
-    if (_orderInColumns) {
+    if (_orderInColumns->isChecked()) {
 	const KstVectorList lOld = l;
 	const int count = lOld.count();
 	const int cols = signed(sqrt(plots.count()));
+	const int rows = cols + (count - cols * cols) / cols;
+	int overflow = count % cols;
 	int row = 0, col = 0;
 	for (int i = 0; i < count; ++i) {
 	    l[row * cols + col] = lOld[i];
 	    ++row;
-	    if (row >= cols) {
-		++col;
-		row = 0;
+	    if (row >= rows) {
+		if (overflow > 0) {
+		    --overflow;
+		} else {
+		    ++col;
+		    row = 0;
+		}
 	    }
 	}
     }


More information about the Kst mailing list