Skip to content

Commit 2f8cec4

Browse files
committed
:octocat: clamp the module scale value between 1 and 50
1 parent 755e075 commit 2f8cec4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/QROptionsTrait.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,13 @@ protected function set_eccLevel(int|string $eccLevel):void{
547547
$this->eccLevel = $eccLevel;
548548
}
549549

550+
/**
551+
* clamps the module scale at a minimum of 1 and a maximum of 50
552+
*/
553+
protected function set_scale(int $scale):void{
554+
$this->scale = max(1, min($scale, 50));
555+
}
556+
550557
/**
551558
* sets/clamps the quiet zone size
552559
*/

0 commit comments

Comments
 (0)