SVG-Edit / svgedit

Powerful SVG-Editor for your browser
MIT License
6.33k stars 1.52k forks source link

Add convertUnit utility function to SvgCanvas instance #965

Closed delmohf closed 2 months ago

delmohf commented 2 months ago

I'm using the bundle version of svgedit (as a package npm i svgedit) and I wanna have access to convertUnit utitlity function in the same way I do with the opposite operation convertToNum.

This work:

import Editor from 'svgedit';
const svgEditor = new Editor(...);
svgEditor.svgCanvas.convertToNum('', '2cm');

This doesn't work:

svgEditor.svgCanvas.convertUnit(38, 'cm');`

image