smiley 3 лет назад
Родитель
Сommit
303458a74c
2 измененных файлов с 8 добавлено и 4 удалено
  1. 3 3
      examples/Readme.md
  2. 5 1
      examples/svgRandomColoredDots.php

+ 3 - 3
examples/Readme.md

@@ -17,7 +17,7 @@
 - [Custom output](./custom_output.php): a simple example that demonstrates the usage of custom output classes
 - [Interactive output](./qrcode-interactive.php): interactive demo (via [index.html](./index.html))
 - [GD Image with logo](./imageWithLogo.php): a logo on top of the QR Code
-- [GD image with text](./imageWithText.php): description text under the QR Code (#35)
+- [GD image with text](./imageWithText.php): description text under the QR Code ([#35](https://github.com/chillerlan/php-qrcode/issues/35))
 - [SVG with logo](./svgWithLogo.php): an SVG QR Code with embedded logo (that is also SVG)
-- [SVG with randomly colored modules](./svgRandomColoredDots.php): a visual effect using multiple colors for the matrix modules (#136)
-- [SVG with a round shape and randomly filled quiet zone](./svgRoundQuietzone.php): example similar to the QR Codes of a certain vendor (#137)
+- [SVG with randomly colored modules](./svgRandomColoredDots.php): a visual effect using multiple colors for the matrix modules ([#136](https://github.com/chillerlan/php-qrcode/discussions/136))
+- [SVG with a round shape and randomly filled quiet zone](./svgRoundQuietzone.php): example similar to the QR Codes of a certain vendor ([#137](https://github.com/chillerlan/php-qrcode/discussions/137))

+ 5 - 1
examples/svgRandomColoredDots.php

@@ -56,7 +56,11 @@ class RandomDotsSVGOutput extends QRMarkupSVG{
 				}
 
 				// collect the modules per $M_TYPE
-				$paths[$M_TYPE_LAYER][] = $transform($x, $y, $M_TYPE, $M_TYPE_LAYER);
+				$module = $transform($x, $y, $M_TYPE, $M_TYPE_LAYER);
+
+				if(!empty($module)){
+					$paths[$M_TYPE_LAYER][] = $module;
+				}
 			}
 		}