@hpcc-js/common 2.71.12 → 2.71.14

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/dist/index.js CHANGED
@@ -5,8 +5,8 @@
5
5
  })(this, (function (exports, util) { 'use strict';
6
6
 
7
7
  var PKG_NAME = "@hpcc-js/common";
8
- var PKG_VERSION = "2.71.12";
9
- var BUILD_VERSION = "2.104.30";
8
+ var PKG_VERSION = "2.71.14";
9
+ var BUILD_VERSION = "2.104.35";
10
10
 
11
11
  /******************************************************************************
12
12
  Copyright (c) Microsoft Corporation.
@@ -7621,11 +7621,17 @@
7621
7621
  var hash = "".concat(bold, "::").concat(fontSize, "::").concat(fontName, "::").concat(text.join("::"));
7622
7622
  var retVal = g_fontSizeContextCache[hash];
7623
7623
  if (!retVal) {
7624
+ retVal = { width: 0, height: 0 };
7624
7625
  g_fontSizeContext.font = "".concat(bold ? "bold " : "").concat(fontSize, "px ").concat(fontName);
7625
- g_fontSizeContextCache[hash] = retVal = {
7626
- width: Math.max.apply(Math, text.map(function (t) { return g_fontSizeContext.measureText("" + t).width; })),
7627
- height: fontSize * text.length
7628
- };
7626
+ text.forEach(function (line) {
7627
+ var textMeasurement = g_fontSizeContext.measureText("" + line);
7628
+ var width = textMeasurement.width;
7629
+ var height = (textMeasurement.fontBoundingBoxDescent + textMeasurement.fontBoundingBoxAscent) * text.length;
7630
+ g_fontSizeContextCache[hash] = retVal = {
7631
+ width: width > retVal.width ? width : retVal.width,
7632
+ height: height > retVal.height ? height : retVal.height
7633
+ };
7634
+ });
7629
7635
  }
7630
7636
  return retVal;
7631
7637
  }
@@ -10575,7 +10581,7 @@
10575
10581
  var width = Math.max.apply(Math, widths);
10576
10582
  var retVal = {
10577
10583
  x: -width / 2,
10578
- y: -height / 2 - lineHeight / (this.fontFamily() === "FontAwesome" ? 4 : 6),
10584
+ y: -height / 2 - lineHeight / (this.fontFamily() === "FontAwesome" ? 4 : 6), // baseLine offset
10579
10585
  width: width,
10580
10586
  height: height
10581
10587
  };