ztxkutils 2.10.66-36 → 2.10.66-37

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.
Files changed (2) hide show
  1. package/dist/print.js +3 -2
  2. package/package.json +1 -1
package/dist/print.js CHANGED
@@ -71,6 +71,7 @@ function getTextDimensions(text, fontSize) {
71
71
  tempElement.style.whiteSpace = 'nowrap'; // 防止文本换行影响宽度测量
72
72
  tempElement.style.fontSize = fontSize;
73
73
  tempElement.style.fontFamily = '微软雅黑';
74
+ tempElement.style.padding = '40px 10px';
74
75
  // 插入到body中
75
76
  document.body.appendChild(tempElement);
76
77
  // 获取元素的宽高
@@ -80,8 +81,8 @@ function getTextDimensions(text, fontSize) {
80
81
  document.body.removeChild(tempElement);
81
82
  // 返回测量结果
82
83
  return {
83
- width: width > 340 ? 340 : width,
84
- height: height > 200 ? 200 : height,
84
+ width: width > 440 ? 440 : width < 240 ? 240 : width,
85
+ height: height > 200 ? 200 : height < 100 ? 100 : height,
85
86
  };
86
87
  }
87
88
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkutils",
3
- "version": "2.10.66-36",
3
+ "version": "2.10.66-37",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",