Commit dade450b authored by h2b's avatar h2b

Another convenience factory method added.

parent 58924fac
......@@ -17,7 +17,7 @@
package de.h2b.scala.lib.simgraf.layout
import de.h2b.scala.lib.simgraf.Pixel
import de.h2b.scala.lib.simgraf.{ Pixel, Screen }
object Floating extends Enumeration {
type Floating = Value
......@@ -112,4 +112,18 @@ object GridLayout {
new GridLayout(rows, cols, cell, floating)
* Constructs a new grid layout of the specified number of rows and columns
* on the whole screen.
* @param floating instructs the iterator to visit the cells either in
* horizontal (first left to right, then top to bottom) or vertical (vice
* versa) order (defaults to horizontal)
* @throws ArithmeticException if `rows` or `cols` is zero
def onScreen (rows: Int, cols: Int, floating: Floating = defaultFloating): GridLayout = {
onRectangle(rows, cols, Screen.width, Screen.height, floating)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment