How to get transformed / Rotated SVG path points

戏子无情 提交于 2019-12-06 03:56:33
philipp

if you get point through path.getPointAtLength(), than you need to apply the transformation of the path to result. You get the total transform by:

var t = path.getTransformToElement( path.ownerSVGElement );
var abspoint = path.getPointAtLength( 0.5 ).matrixTransform( t );

I have not testes this,but this might be the way...

That is good for some points on the path. If the whole list of path data should be converted to absolute, than raphael might be the fastest solution...

There's no functionality in svg itself that provides that. Not in jQuery either AFAIK.

The javascript library Raphaël contains a utility method for what you want though, see Raphael.transformPath.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!