HTML5 Canvas get transform matrix?

前端 未结 4 1913
一向
一向 2020-12-14 06:57

Is there a way to get the current transformation matrix for a canvas? There is a context.setTransform() function, but there does not seem to be a getTransform() equivalent a

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-14 07:36

    As @ellisbben mentioned pretty much the only way you can do this is to keep track of it yourself. You can find one solution here. It wraps the context within a wrapper and then handles the nasty bits there.

提交回复
热议问题