@widergy/energy-ui 3.86.1 → 3.86.2
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.86.2](https://github.com/widergy/energy-ui/compare/v3.86.1...v3.86.2) (2025-07-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* dynamic font document wizard ([#634](https://github.com/widergy/energy-ui/issues/634)) ([56be162](https://github.com/widergy/energy-ui/commit/56be1629374b7a7d193d78c7cb3de383ee2f13c0))
|
|
7
|
+
|
|
1
8
|
## [3.86.1](https://github.com/widergy/energy-ui/compare/v3.86.0...v3.86.1) (2025-07-11)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.handleMouseMove = exports.handleCanvasClick = exports.drawSection = void 0;
|
|
7
7
|
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
8
8
|
var _colorUtils = require("../../../../utils/colorUtils");
|
|
9
|
+
var _classesUtils = require("../../../../utils/classesUtils");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
const drawRoundedStrokeRect = (ctx, x, y, width, height, radius) => {
|
|
11
12
|
ctx.save();
|
|
@@ -29,11 +30,12 @@ const drawRoundedStrokeRect = (ctx, x, y, width, height, radius) => {
|
|
|
29
30
|
ctx.stroke();
|
|
30
31
|
};
|
|
31
32
|
const resizeText = (ctx, text, maxWidth) => {
|
|
33
|
+
const fontFamily = (0, _classesUtils.resolveCssValue)('var(--fontFamily)') || 'Inter';
|
|
32
34
|
let fontSize = 14;
|
|
33
|
-
ctx.font = "600 ".concat(fontSize, "px
|
|
35
|
+
ctx.font = "600 ".concat(fontSize, "px ").concat(fontFamily);
|
|
34
36
|
while (ctx.measureText(text).width > maxWidth && fontSize > 10) {
|
|
35
37
|
fontSize -= 1;
|
|
36
|
-
ctx.font = "600 ".concat(fontSize, "px
|
|
38
|
+
ctx.font = "600 ".concat(fontSize, "px ").concat(fontFamily);
|
|
37
39
|
}
|
|
38
40
|
return fontSize;
|
|
39
41
|
};
|