Skip to content

Commit 0820097

Browse files
committed
fix(servo): broken on safari
apparently, SVG `transform-origin` attribute doesn't work on safari, so instead we change the origin of the rotation using a pair of `translate` transforms. close #39
1 parent de969e0 commit 0820097

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/servo-element.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ export class ServoElement extends LitElement {
7373
<circle fill="#999" cx="91.467" cy="59.773" r="18.606" />
7474
<path
7575
fill=${this.hornColor}
76-
transform="rotate(${this.angle})"
77-
transform-origin="91.467 59.773"
76+
transform="translate(91.467 59.773) rotate(${this.angle ?? 0}) translate(-91.467 -59.773)"
7877
d="${this.hornPath()}"
7978
/>
8079
<circle fill="gray" cx="91.467" cy="59.773" r="8.3729" />

0 commit comments

Comments
 (0)