mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-10-17 01:05:52 +00:00
:octocat: re-introduce QRMatrix::flip() (6c66d56a31) as bitmask rework (#205) won't happen any time soon
This commit is contained in:
+14
-2
@@ -314,6 +314,18 @@ class QRMatrix{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flips the value of the module at ($x, $y)
|
||||
*/
|
||||
public function flip(int $x, int $y):self{
|
||||
|
||||
if(isset($this->matrix[$y][$x])){
|
||||
$this->matrix[$y][$x] ^= $this::IS_DARK;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the module at ($x, $y) is of the given $M_TYPE
|
||||
*
|
||||
@@ -617,7 +629,7 @@ class QRMatrix{
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->set($x, $y, ($val & $this::IS_DARK) !== $this::IS_DARK, $val);
|
||||
$this->flip($x, $y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -774,7 +786,7 @@ class QRMatrix{
|
||||
}
|
||||
|
||||
if($mask($x, $y)){
|
||||
$this->set($x, $y, ($val & $this::IS_DARK) !== $this::IS_DARK, $val);
|
||||
$this->flip($x, $y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user