You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
410 B
13 lines
410 B
/**
|
|
* scale a shape to a given size
|
|
*/
|
|
export function scaleToPixel(el, size, applyScale) {
|
|
if (applyScale === void 0) { applyScale = false; }
|
|
var _a = el.getBBox(), width = _a.width, height = _a.height;
|
|
var scale = size / Math.max(width, height);
|
|
if (applyScale) {
|
|
el.style.transform = "scale(".concat(scale, ")");
|
|
}
|
|
return scale;
|
|
}
|
|
//# sourceMappingURL=scale-to-pixel.js.map
|