mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: normalizeSVG width and height from viewbox when size includes decimal points (#8939)
Update image.ts
This commit is contained in:
parent
1e3399eac8
commit
56fca30bd0
1 changed files with 3 additions and 1 deletions
|
@ -124,7 +124,9 @@ export const normalizeSVG = (SVGString: string) => {
|
||||||
height = height || "50";
|
height = height || "50";
|
||||||
|
|
||||||
if (viewBox) {
|
if (viewBox) {
|
||||||
const match = viewBox.match(/\d+ +\d+ +(\d+) +(\d+)/);
|
const match = viewBox.match(
|
||||||
|
/\d+ +\d+ +(\d+(?:\.\d+)?) +(\d+(?:\.\d+)?)/,
|
||||||
|
);
|
||||||
if (match) {
|
if (match) {
|
||||||
[, width, height] = match;
|
[, width, height] = match;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue