:octocat:

This commit is contained in:
codemasher
2019-07-31 00:45:45 +02:00
parent 3503160406
commit d0a8f97a3e
2 changed files with 7 additions and 3 deletions
+2 -2
View File
@@ -88,10 +88,10 @@ class QRImageWithText extends QRImage{
$fontColor = \imagecolorallocate($this->image, ...$textColor);
$w = \imagefontwidth($textSize);
$x = round(($bgWidth - strlen($text) * $w) / 2);
$x = \round(($bgWidth - \strlen($text) * $w) / 2);
// loop through the string and draw the letters
foreach(str_split($text) as $i => $chr){
foreach(\str_split($text) as $i => $chr){
\imagechar($this->image, $textSize, $i * $w + $x, $this->length, $chr, $fontColor);
}
}