How to specify the x-y rotation point when using animateTransform?

前端 未结 2 2091
面向向阳花
面向向阳花 2021-02-14 21:15

I want to use animateTransform to rotate an SVG image continuously. So here we go:





        
2条回答
  •  暖寄归人
    2021-02-14 21:32

    http://www.w3.org/TR/SVG/animate.html#AnimateTransformElement

    The ‘from’, ‘by’ and ‘to’ attributes take a value expressed using the same syntax that is available for the given transformation type:
    (...)
    For a type="rotate", each individual value is expressed as [ ]

    You can specify the center for the rotation if you provide 2 additional values, cx and cy.

    So, for your piece of code, I add "50 50" in the "from" and "to" attribute :

    
        
    
    

    It work with latest version of Opera, Safari and Chrome, also Firefrox 4 Beta and Batik.

提交回复
热议问题