【发布时间】:2018-02-16 02:55:19
【问题描述】:
鉴于 SVG 中的以下矩形。
<rect xmlns="http://www.w3.org/2000/svg" x="72.036" y="156.473" transform="matrix(0.1727 -0.985 0.985 0.1727 -83.7081 215.7814)" style="fill:none;stroke:#020202;stroke-width:0.5;stroke-miterlimit:10;" width="29.129" height="2.498"/>
矩形上方希望在 KonvaJS 中相应地呈现为 Konva.Rect https://konvajs.github.io/api/Konva.Rect.html
基于矩阵的分解,应应用以下内容: 翻译(-83.7081, 215.781) 旋转(-80.0554125754873) 规模(1.0000251446838724)
据我了解,可以应用旋转、缩放和倾斜,但如何应用平移值? 应该将它们添加到 x 和 y 还是添加到 offsetX/offsetY?
或者有没有办法将 Transform 类应用于 Rect?
谢谢。
【问题讨论】: