minutool 1.0.17 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1624,6 +1624,16 @@ export declare const stripSlashes: (str: string) => string;
1624
1624
  */
1625
1625
  export declare const strToPascalCase: (str: string, capitalize_first?: boolean) => string;
1626
1626
 
1627
+ /**
1628
+ * 兼容方式获取svg的BBox,避免Firefox获取svg尺寸时,额外考虑了父容器的zoom
1629
+ * @param {SVGSVGElement} svg
1630
+ * @returns {DOMRect}
1631
+ * @returns {DOMRect.width} 单位px
1632
+ * @returns {DOMRect.height} 单位px
1633
+ * @see https://stackoverflow.com/questions/60814803/getboundingbox-of-svg-element-in-firefox
1634
+ */
1635
+ export declare const svgGetBBox: (svg: SVGSVGElement) => DOMRect;
1636
+
1627
1637
  /**
1628
1638
  * svg 对象转换为图片对象
1629
1639
  * @returns
package/dist/minutool.js CHANGED
@@ -1447,6 +1447,7 @@ export {
1447
1447
  Le as strToPascalCase,
1448
1448
  Un as stringToEntity,
1449
1449
  Se as stripSlashes,
1450
+ Ht as svgGetBBox,
1450
1451
  Ft as svgToImg,
1451
1452
  qn as svgToImgData,
1452
1453
  Pt as svgToSrc,