jack 1 неделя назад
Родитель
Сommit
df6c1797d6
1 измененных файлов с 6 добавлено и 4 удалено
  1. 6 4
      src/hooks/useImport.ts

+ 6 - 4
src/hooks/useImport.ts

@@ -1947,10 +1947,12 @@ export default () => {
                 }
 
                 if (shape) {
-                  element.path = shape.path
-                  // const { maxX, maxY } = getSvgPathRange(el.path);
-                  element.viewBox = shape.viewBox
-                  // element.viewBox = [originWidth || maxX, originHeight || maxY];
+                  //element.path = shape.path
+                  //element.viewBox = shape.viewBox
+                  const { maxX, maxY } = getSvgPathRange(el.path)
+                  element.path = el.path
+                  element.viewBox = poriginWidth ? [maxX, maxY] : [originWidth, originHeight]
+
                   if (shape.pathFormula) {
                     element.pathFormula = shape.pathFormula
                     element.viewBox = [el.width, el.height]