Search code examples
javascripthtmlsvgsvg-edit

Transforming a path in svg-editor, method draw using user-input values


I am wondering if it would be possible to resize a path using values inputted by the user after he draws the path. Setting the width and height for example.

I am currently using the transform attribute within a JS function to do that but while the path gets resized, the handles of the path stay in the original position which makes the thing a total mess.

Any ideas?


Solution

  • Assuming the path is is selected:

    svgCanvas.changeSelectedAttribute("transform", "scale(0.5, 1)");