mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-31 04:28:03 +00:00
💄
This commit is contained in:
@@ -578,9 +578,8 @@ class QRMatrix{
|
||||
$startY = ((($startY !== null) ? $startY : ($length - $height) / 2) + $qz);
|
||||
|
||||
// clear the space
|
||||
foreach($this->matrix as $y => $row){
|
||||
/** @SuppressWarnings(PHPMD.UnusedLocalVariable) */
|
||||
foreach($row as $x => $val){
|
||||
for($y = 0; $y < $this->moduleCount; $y++){
|
||||
for($x = 0; $x < $this->moduleCount; $x++){
|
||||
// out of bounds, skip
|
||||
if($x < $start || $y < $start ||$x >= $end || $y >= $end){
|
||||
continue;
|
||||
|
||||
@@ -204,16 +204,12 @@ final class Binarizer{
|
||||
* @see http://groups.google.com/group/zxing/browse_thread/thread/d06efa2c35a7ddc0
|
||||
*/
|
||||
private function calculateBlackPoints(int $subWidth, int $subHeight, int $width, int $height):array{
|
||||
$blackPoints = array_fill(0, $subHeight, 0);
|
||||
|
||||
/** @SuppressWarnings(PHPMD.UnusedLocalVariable) */
|
||||
foreach($blackPoints as $key => $point){
|
||||
$blackPoints[$key] = array_fill(0, $subWidth, 0);
|
||||
}
|
||||
$blackPoints = [];
|
||||
|
||||
for($y = 0; $y < $subHeight; $y++){
|
||||
$yoffset = ($y << self::BLOCK_SIZE_POWER);
|
||||
$maxYOffset = ($height - self::BLOCK_SIZE);
|
||||
$yoffset = ($y << self::BLOCK_SIZE_POWER);
|
||||
$maxYOffset = ($height - self::BLOCK_SIZE);
|
||||
$blackPoints[$y] = [];
|
||||
|
||||
if($yoffset > $maxYOffset){
|
||||
$yoffset = $maxYOffset;
|
||||
|
||||
Reference in New Issue
Block a user