victory-area 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 +2 -0
- package/dist/victory-area.js +7 -6
- package/dist/victory-area.min.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/victory-area.js
CHANGED
|
@@ -14179,6 +14179,9 @@ var _approximateDimensionsInternal = function (text, style) {
|
|
|
14179
14179
|
var _getMeasurementContainer = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___default()(function () {
|
|
14180
14180
|
var element = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
14181
14181
|
element.setAttribute("xlink", "http://www.w3.org/1999/xlink");
|
|
14182
|
+
element.setAttribute("width", "300");
|
|
14183
|
+
element.setAttribute("height", "300");
|
|
14184
|
+
element.setAttribute("viewBox", "0 0 300 300");
|
|
14182
14185
|
var containerElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
14183
14186
|
element.appendChild(containerElement);
|
|
14184
14187
|
element.style.position = "fixed";
|
|
@@ -14213,7 +14216,6 @@ var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___def
|
|
|
14213
14216
|
var params = _prepareParams(style, i);
|
|
14214
14217
|
|
|
14215
14218
|
textElement.style.fontFamily = params.fontFamily;
|
|
14216
|
-
textElement.style.transform = "rotate(".concat(params.angle, ")");
|
|
14217
14219
|
textElement.style.fontSize = "".concat(params.fontSize, "px");
|
|
14218
14220
|
textElement.style.lineHeight = params.lineHeight;
|
|
14219
14221
|
textElement.style.fontFamily = params.fontFamily;
|
|
@@ -14221,18 +14223,17 @@ var _measureDimensionsInternal = lodash_memoize__WEBPACK_IMPORTED_MODULE_0___def
|
|
|
14221
14223
|
textElement.textContent = line;
|
|
14222
14224
|
textElement.setAttribute("x", "0");
|
|
14223
14225
|
textElement.setAttribute("y", "".concat(heightAcc));
|
|
14224
|
-
heightAcc += params.lineHeight * params.fontSize;
|
|
14225
14226
|
containerElement.appendChild(textElement);
|
|
14227
|
+
heightAcc += params.lineHeight * textElement.getBoundingClientRect().height;
|
|
14226
14228
|
}
|
|
14227
14229
|
|
|
14228
14230
|
var _containerElement$get = containerElement.getBoundingClientRect(),
|
|
14229
|
-
width = _containerElement$get.width
|
|
14230
|
-
height = _containerElement$get.height;
|
|
14231
|
+
width = _containerElement$get.width;
|
|
14231
14232
|
|
|
14232
14233
|
containerElement.innerHTML = "";
|
|
14233
14234
|
return {
|
|
14234
|
-
width: width,
|
|
14235
|
-
height:
|
|
14235
|
+
width: style !== null && style !== void 0 && style.angle ? _getSizeWithRotate(width, heightAcc, style === null || style === void 0 ? void 0 : style.angle) : width,
|
|
14236
|
+
height: style !== null && style !== void 0 && style.angle ? _getSizeWithRotate(heightAcc, width, style === null || style === void 0 ? void 0 : style.angle) : heightAcc
|
|
14236
14237
|
};
|
|
14237
14238
|
}, function (text, style) {
|
|
14238
14239
|
var totalText = Array.isArray(text) ? text.join() : text;
|