Commit 4d812254 authored by Nicolas Dunand's avatar Nicolas Dunand Committed by Cecilia Vela Gurovic
Browse files

Bug 1766833: increase maxlayoutrows

1. raises this limit to 20
2. shows smaller preview rows for layouts having >= 60 rows

behatnotneeded

Change-Id: I4aabed614a6c2a649d62eca38f1f70e3a1bc7853
parent 2d54d56b
...@@ -25,6 +25,7 @@ class LayoutPreviewImage { ...@@ -25,6 +25,7 @@ class LayoutPreviewImage {
private static $one_row_height = 65; private static $one_row_height = 65;
private static $two_row_height = 31; private static $two_row_height = 31;
private static $three_row_height = 20; private static $three_row_height = 20;
private static $six_row_height = 8;
private static $spacer = 3; private static $spacer = 3;
/* Constructor. /* Constructor.
...@@ -93,6 +94,9 @@ class LayoutPreviewImage { ...@@ -93,6 +94,9 @@ class LayoutPreviewImage {
if ($this->rows == 1) { if ($this->rows == 1) {
return self::$one_row_height; return self::$one_row_height;
} }
if ($this->rows > 5) {
return $this->rows * self::$six_row_height + ($this->rows - 1) * self::$spacer;
}
if ($this->rows > 2) { if ($this->rows > 2) {
return $this->rows * self::$three_row_height + ($this->rows - 1) * self::$spacer; return $this->rows * self::$three_row_height + ($this->rows - 1) * self::$spacer;
} }
...@@ -103,6 +107,9 @@ class LayoutPreviewImage { ...@@ -103,6 +107,9 @@ class LayoutPreviewImage {
if ($this->rows == 1) { if ($this->rows == 1) {
return self::$one_row_height; return self::$one_row_height;
} }
if ($this->rows > 5) {
return self::$six_row_height;
}
if ($this->rows > 2) { if ($this->rows > 2) {
return self::$three_row_height; return self::$three_row_height;
} }
......
...@@ -224,7 +224,7 @@ class View { ...@@ -224,7 +224,7 @@ class View {
), ),
); );
public static $maxlayoutrows = 6; // see number of colours avail in layoutpreview.php public static $maxlayoutrows = 20;
/** /**
* For retrieving and checking numbers of columnns in any given row * For retrieving and checking numbers of columnns in any given row
......
Supports Markdown
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