Skip to content

Commit

Permalink
feat: Round up the calculated sizes of files
Browse files Browse the repository at this point in the history
We do not want decimal points for pixel values.
  • Loading branch information
justusmoroni committed Apr 4, 2024
1 parent 80a0873 commit 61d9cd8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Classes/Sizes/Rootline.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ private function calculateFinalSizes(array $sizes, array $multiplier): void

$size *= $multiplierItem[$sizeName];
}

$size = ceil($size);
}

$this->finalSizes = $sizes;
Expand Down
14 changes: 7 additions & 7 deletions Tests/Functional/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public static function imageScalingValuesDataProvider(): iterable
[
'0' => 'mobile 734 (max-width: 480px)',
'1' => 'mobile 704 (max-width: 767px)',
'2' => 'tablet 615.384 (max-width: 991px)',
'3' => 'default 748.584 (max-width: 1479px)',
'4' => 'large 374.292 (min-width: 1480px)',
'2' => 'tablet 616 (max-width: 991px)',
'3' => 'default 749 (max-width: 1479px)',
'4' => 'large 375 (min-width: 1480px)',
],
];
yield '2 Column in 1 Column' => [
Expand All @@ -122,17 +122,17 @@ public static function imageScalingValuesDataProvider(): iterable
'1' => 'mobile 704 (max-width: 767px)',
'2' => 'tablet 231 (max-width: 991px)',
'3' => 'default 281 (max-width: 1479px)',
'4' => 'large 140.5 (min-width: 1480px)',
'4' => 'large 141 (min-width: 1480px)',
],
];
yield '3 Column' => [
'3colDatabase.php',
[
'0' => 'mobile 734 (max-width: 480px)',
'1' => 'mobile 704 (max-width: 767px)',
'2' => 'tablet 307.692 (max-width: 991px)',
'3' => 'default 374.292 (max-width: 1479px)',
'4' => 'large 187.146 (min-width: 1480px)',
'2' => 'tablet 308 (max-width: 991px)',
'3' => 'default 375 (max-width: 1479px)',
'4' => 'large 188 (min-width: 1480px)',
],
];
yield '1 Column Full Width' => [
Expand Down

0 comments on commit 61d9cd8

Please sign in to comment.