mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-30 20:17:17 +00:00
:octocat: moved mask pattern clamp to options
This commit is contained in:
+1
-1
@@ -156,7 +156,7 @@ class QRCode{
|
||||
|
||||
$maskPattern = $this->options->maskPattern === $this::MASK_PATTERN_AUTO
|
||||
? $this->getBestMaskPattern()
|
||||
: min(7, max(0, (int)$this->options->maskPattern));
|
||||
: $this->options->maskPattern;
|
||||
|
||||
$matrix = $this->dataInterface->initMatrix($maskPattern);
|
||||
|
||||
|
||||
@@ -251,6 +251,10 @@ trait QROptionsTrait{
|
||||
$min = $this->versionMin;
|
||||
$this->versionMin = (int)min($min, $max);
|
||||
$this->versionMax = (int)max($min, $max);
|
||||
|
||||
if($this->maskPattern !== QRCode::MASK_PATTERN_AUTO){
|
||||
$this->maskPattern = min(7, max(0, (int)$this->maskPattern));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user