diff --git a/src/Gregwar/Captcha/CaptchaBuilder.php b/src/Gregwar/Captcha/CaptchaBuilder.php index 8dbbd61..fcba934 100644 --- a/src/Gregwar/Captcha/CaptchaBuilder.php +++ b/src/Gregwar/Captcha/CaptchaBuilder.php @@ -345,8 +345,8 @@ protected function writePhrase($image, $phrase, $font, $width, $height) $box = \imagettfbbox($size, 0, $font, $phrase); $textWidth = $box[2] - $box[0]; $textHeight = $box[1] - $box[7]; - $x = ($width - $textWidth) / 2; - $y = ($height - $textHeight) / 2 + $size; + $x = (int)(($width - $textWidth) / 2); + $y = (int)(($height - $textHeight) / 2 + $size); if (!$this->textColor) { $textColor = array($this->rand(0, 150), $this->rand(0, 150), $this->rand(0, 150));