hsu-utils 0.0.28 → 0.0.29

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * hsu-utils v0.0.27
3
+ * hsu-utils v0.0.28
4
4
  *
5
5
  * some front-end utils
6
6
  *
@@ -8,5 +8,5 @@ export default function get_string_size(str, font = {}, letterSpacing = 0) {
8
8
  const height = +(+metrics.actualBoundingBoxAscent.toFixed(2) + +metrics.actualBoundingBoxDescent.toFixed(2)).toFixed(2);
9
9
  const _letterSpacing = (str.length > 0 ? str.length - 1 : 0) * letterSpacing;
10
10
  width += _letterSpacing;
11
- return { width, height };
11
+ return { width: +width.toFixed(2), height: +height.toFixed(2) };
12
12
  }
@@ -12,6 +12,6 @@ function get_string_size(str, font, letterSpacing) {
12
12
  var height = +(+metrics.actualBoundingBoxAscent.toFixed(2) + +metrics.actualBoundingBoxDescent.toFixed(2)).toFixed(2);
13
13
  var _letterSpacing = (str.length > 0 ? str.length - 1 : 0) * letterSpacing;
14
14
  width += _letterSpacing;
15
- return { width: width, height: height };
15
+ return { width: +width.toFixed(2), height: +height.toFixed(2) };
16
16
  }
17
17
  exports.default = get_string_size;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hsu-utils",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "some front-end utils",
5
5
  "repository": "git@github.com:VitaTsui/hsu-utils.git",
6
6
  "author": "VitaHsu <vitahsu7@gmail.com>",