Smarter zooming when not all rows in the layout are used.
authorSamuel Rødal <samuel.rodal@nokia.com>
Mon, 21 Mar 2011 08:07:25 +0000 (09:07 +0100)
committerSamuel Rødal <samuel.rodal@nokia.com>
Mon, 21 Mar 2011 08:07:25 +0000 (09:07 +0100)
examples/qml-compositor/qml/QmlCompositor/compositor.js

index 834aa99..22a9feb 100644 (file)
@@ -46,11 +46,13 @@ function relayout() {
         return;
 
     var dim = Math.ceil(Math.sqrt(windowList.length));
-    var w = root.width / dim;
-    var h = root.height / dim;
 
     var cols = dim;
-    var rows = Math.floor(windowList.length / cols);
+    var rows = Math.ceil(windowList.length / cols);
+
+    var w = root.width / dim;
+    var h = root.height / rows;
+
     var i;
     var ix = 0;
     var iy = 0;