@@ -42,7 +42,7 @@ protected function prepareRenderParams(array $options, Transform $transform, ?Fo
42
42
*/
43
43
protected function renderFill ($ image , $ params , int $ color ): void
44
44
{
45
- imagefilledellipse ($ image , $ params ['cx ' ], $ params ['cy ' ], $ params ['width ' ], $ params ['height ' ], $ color );
45
+ imagefilledellipse ($ image , ( int ) round ( $ params ['cx ' ]), ( int ) round ( $ params ['cy ' ]), ( int ) round ( $ params ['width ' ]), ( int ) round ( $ params ['height ' ]) , $ color );
46
46
}
47
47
48
48
/**
@@ -52,16 +52,10 @@ protected function renderStroke($image, $params, int $color, float $strokeWidth)
52
52
{
53
53
imagesetthickness ($ image , round ($ strokeWidth ));
54
54
55
- $ width = $ params ['width ' ];
56
- if ($ width % 2 === 0 ) {
57
- $ width += 1 ;
58
- }
59
- $ height = $ params ['height ' ];
60
- if ($ height % 2 === 0 ) {
61
- $ height += 1 ;
62
- }
55
+ $ width = (int )round ($ params ['width ' ]) | 1 ;
56
+ $ height = (int )round ($ params ['height ' ]) | 1 ;
63
57
64
58
// imageellipse ignores imagesetthickness; draw arc instead
65
- imagearc ($ image , $ params ['cx ' ], $ params ['cy ' ], $ width , $ height , 0 , 360 , $ color );
59
+ imagearc ($ image , ( int ) round ( $ params ['cx ' ]), ( int ) round ( $ params ['cy ' ]) , $ width , $ height , 0 , 360 , $ color );
66
60
}
67
61
}
0 commit comments