Skip to content

Commit

Permalink
fix(servo): broken on safari
Browse files Browse the repository at this point in the history
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
  • Loading branch information
urish committed Jul 31, 2020
1 parent de969e0 commit 0820097
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/servo-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ export class ServoElement extends LitElement {
<circle fill="#999" cx="91.467" cy="59.773" r="18.606" />
<path
fill=${this.hornColor}
transform="rotate(${this.angle})"
transform-origin="91.467 59.773"
transform="translate(91.467 59.773) rotate(${this.angle ?? 0}) translate(-91.467 -59.773)"
d="${this.hornPath()}"
/>
<circle fill="gray" cx="91.467" cy="59.773" r="8.3729" />
Expand Down

0 comments on commit 0820097

Please sign in to comment.