victory-create-container 36.6.10 → 36.6.12

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