File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -32,16 +32,16 @@ public function handle(): Response
32
32
$ text = wordwrap ($ this ->article ->title (), self ::CHARACTERS_PER_LINE );
33
33
34
34
return Cache::remember (
35
- 'articleSocialImage- ' . $ this ->article ->id ,
35
+ 'articleSocialImage- ' . $ this ->article ->id ,
36
36
now ()->addDay (),
37
- fn () => response (
38
- $ image ->read (resource_path ('images/ ' . self ::TEMPLATE ))
37
+ fn () => response (
38
+ $ image ->read (resource_path ('images/ ' . self ::TEMPLATE ))
39
39
->text (
40
40
$ text ,
41
41
self ::TEXT_X_POSITION ,
42
42
self ::calculateTextYPosition ($ text ),
43
43
function ($ font ) {
44
- $ font ->file (resource_path ('fonts/ ' . self ::FONT ));
44
+ $ font ->file (resource_path ('fonts/ ' . self ::FONT ));
45
45
$ font ->size (self ::FONT_SIZE );
46
46
$ font ->color (self ::TEXT_COLOUR );
47
47
}
@@ -57,7 +57,7 @@ private function calculateTextYPosition(string $text): int
57
57
{
58
58
$ noOfLinesInText = substr_count ($ text , "\n" );
59
59
60
- return self ::TEXT_Y_BASE_POSITION
60
+ return self ::TEXT_Y_BASE_POSITION
61
61
+ ((self ::FONT_SIZE * $ noOfLinesInText ) - $ noOfLinesInText );
62
62
}
63
63
}
You can’t perform that action at this time.
0 commit comments