victory-create-container 36.6.10 → 36.6.11
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
|
@@ -16228,6 +16228,9 @@ var _approximateDimensionsInternal = function (text, style) {
|
|
|
16228
16228
|
var _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function () {
|
|
16229
16229
|
var element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
16230
16230
|
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
16231
|
+
element.setAttribute("width", "300");
|
|
16232
|
+
element.setAttribute("height", "300");
|
|
16233
|
+
element.setAttribute("viewBox", "0 0 300 300");
|
|
16231
16234
|
var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
16232
16235
|
element.appendChild(containerElement);
|
|
16233
16236
|
element.style.position = "fixed";
|
|
@@ -16262,7 +16265,6 @@ var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___def
|
|
|
16262
16265
|
var params = _prepareParams(style, i);
|
|
16263
16266
|
|
|
16264
16267
|
textElement.style.fontFamily = params.fontFamily;
|
|
16265
|
-
textElement.style.transform = "rotate(".concat(params.angle, ")");
|
|
16266
16268
|
textElement.style.fontSize = "".concat(params.fontSize, "px");
|
|
16267
16269
|
textElement.style.lineHeight = params.lineHeight;
|
|
16268
16270
|
textElement.style.fontFamily = params.fontFamily;
|
|
@@ -16270,18 +16272,17 @@ var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___def
|
|
|
16270
16272
|
textElement.textContent = line;
|
|
16271
16273
|
textElement.setAttribute("x", "0");
|
|
16272
16274
|
textElement.setAttribute("y", "".concat(heightAcc));
|
|
16273
|
-
heightAcc += params.lineHeight * params.fontSize;
|
|
16274
16275
|
containerElement.appendChild(textElement);
|
|
16276
|
+
heightAcc += params.lineHeight * textElement.getBoundingClientRect().height;
|
|
16275
16277
|
}
|
|
16276
16278
|
|
|
16277
16279
|
var _containerElement$get = containerElement.getBoundingClientRect(),
|
|
16278
|
-
width = _containerElement$get.width
|
|
16279
|
-
height = _containerElement$get.height;
|
|
16280
|
+
width = _containerElement$get.width;
|
|
16280
16281
|
|
|
16281
16282
|
containerElement.innerHTML = "";
|
|
16282
16283
|
return {
|
|
16283
|
-
width: width,
|
|
16284
|
-
height:
|
|
16284
|
+
width: style !== null && style !== void 0 && style.angle ? _getSizeWithRotate(width, heightAcc, style === null || style === void 0 ? void 0 : style.angle) : width,
|
|
16285
|
+
height: style !== null && style !== void 0 && style.angle ? _getSizeWithRotate(heightAcc, width, style === null || style === void 0 ? void 0 : style.angle) : heightAcc
|
|
16285
16286
|
};
|
|
16286
16287
|
}, function (text, style) {
|
|
16287
16288
|
var totalText = Array.isArray(text) ? text.join() : text;
|