Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbf0a110

Browse files
authored
fix: Apply defaults for cx, cy, rx, ry in EllipseRenderer (#210)
Fixed default ellipse properties according to SVG specificationhttps://www.w3.org/TR/SVG2/geometry.html
1 parentd586efb commitbf0a110

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/Rasterization/Renderers/EllipseRenderer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ class EllipseRenderer extends MultiPassRenderer
2121
*/
2222
protectedfunctionprepareRenderParams(array$options,Transform$transform, ?FontRegistry$fontRegistry): ?array
2323
{
24-
$cx =$options['cx'];
25-
$cy =$options['cy'];
24+
$cx =$options['cx'] ??0;
25+
$cy =$options['cy'] ??0;
2626
$transform->map($cx,$cy);
2727

28-
$width =$options['rx'] *2;
29-
$height =$options['ry'] *2;
28+
$width =($options['rx'] ??$options['ry'] ??0) *2;
29+
$height =($options['ry'] ??$options['rx'] ??0) *2;
3030
$transform->resize($width,$height);
3131

3232
return [

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp