Skip to content

Commit ba6a343

Browse files
committed
wip
1 parent d32365c commit ba6a343

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/Jobs/GenerateSocialShareImage.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ function ($font) {
5555

5656
private function calculateTextYPosition(string $text): int
5757
{
58+
$noOfLinesInText = substr_count($text, "\n");
59+
5860
return self::TEXT_Y_BASE_POSITION
59-
+ ((self::FONT_SIZE * substr_count($text, "\n")) - substr_count($text, "\n"));
61+
+ ((self::FONT_SIZE * $noOfLinesInText) - $noOfLinesInText);
6062
}
6163
}

0 commit comments

Comments
 (0)