I am doing a modification of svg-edit and i have written a function where the user selects an element and clicks a button to fire a function that asks for new dimensions and the element gets resized to the resized dimensions.
However there is a problem. When dimensions get resized the stroke width gets resized as well sometimes. The lines appear thinner. Is there any way to prevent this from happening?
this is my function:
function changeDimensions()
{
svgNode = svgCanvas.getSelectedElems()[0];
var transformw=prompt("Enter your new width");
var transformh=prompt("Enter your new height");
var lastw = svgNode.getBoundingClientRect().width;
var lasth = svgNode.getBoundingClientRect().height;
newW=transformw/lastw;
newH=transformh/lasth;
alert(newH);
alert(newW);
svgCanvas.changeSelectedAttribute("transform", "matrix(" + newW + ", 0, 0, " + newH + ", 0, 0)");
svgCanvas.recalculateAllSelectedDimensions();
}