babylonjs-gui 5.6.0 → 5.8.0

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/babylon.gui.d.ts CHANGED
@@ -3559,6 +3559,7 @@ declare module BABYLON.GUI {
3559
3559
  private _outlineColor;
3560
3560
  private _underline;
3561
3561
  private _lineThrough;
3562
+ private _wordDivider;
3562
3563
  /**
3563
3564
  * An event triggered after the text is changed
3564
3565
  */
@@ -3655,6 +3656,14 @@ declare module BABYLON.GUI {
3655
3656
  * Gets or sets outlineColor of the text to display
3656
3657
  */
3657
3658
  set outlineColor(value: string);
3659
+ /**
3660
+ * Gets or sets word divider
3661
+ */
3662
+ get wordDivider(): string;
3663
+ /**
3664
+ * Gets or sets word divider
3665
+ */
3666
+ set wordDivider(value: string);
3658
3667
  /**
3659
3668
  * Creates a new TextBlock object
3660
3669
  * @param name defines the name of the control
package/babylon.gui.js CHANGED
@@ -1759,7 +1759,7 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
1759
1759
  this.markAsDirty();
1760
1760
  };
1761
1761
  /** Define the Uurl to load snippets */
1762
- AdvancedDynamicTexture.SnippetUrl = "https://snippet.babylonjs.com";
1762
+ AdvancedDynamicTexture.SnippetUrl = core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.Constants.SnippetUrl;
1763
1763
  /** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */
1764
1764
  AdvancedDynamicTexture.AllowGPUOptimizations = true;
1765
1765
  return AdvancedDynamicTexture;
@@ -14407,6 +14407,7 @@ var TextBlock = /** @class */ (function (_super) {
14407
14407
  _this._outlineColor = "white";
14408
14408
  _this._underline = false;
14409
14409
  _this._lineThrough = false;
14410
+ _this._wordDivider = " ";
14410
14411
  /**
14411
14412
  * An event triggered after the text is changed
14412
14413
  */
@@ -14631,6 +14632,26 @@ var TextBlock = /** @class */ (function (_super) {
14631
14632
  enumerable: false,
14632
14633
  configurable: true
14633
14634
  });
14635
+ Object.defineProperty(TextBlock.prototype, "wordDivider", {
14636
+ /**
14637
+ * Gets or sets word divider
14638
+ */
14639
+ get: function () {
14640
+ return this._wordDivider;
14641
+ },
14642
+ /**
14643
+ * Gets or sets word divider
14644
+ */
14645
+ set: function (value) {
14646
+ if (this._wordDivider === value) {
14647
+ return;
14648
+ }
14649
+ this._wordDivider = value;
14650
+ this._markAsDirty();
14651
+ },
14652
+ enumerable: false,
14653
+ configurable: true
14654
+ });
14634
14655
  TextBlock.prototype._getTypeName = function () {
14635
14656
  return "TextBlock";
14636
14657
  };
@@ -14812,10 +14833,10 @@ var TextBlock = /** @class */ (function (_super) {
14812
14833
  TextBlock.prototype._parseLineWordWrap = function (line, width, context) {
14813
14834
  if (line === void 0) { line = ""; }
14814
14835
  var lines = [];
14815
- var words = this.wordSplittingFunction ? this.wordSplittingFunction(line) : line.split(" ");
14836
+ var words = this.wordSplittingFunction ? this.wordSplittingFunction(line) : line.split(this._wordDivider);
14816
14837
  var lineWidth = this._getTextMetricsWidth(context.measureText(line));
14817
14838
  for (var n = 0; n < words.length; n++) {
14818
- var testLine = n > 0 ? line + " " + words[n] : words[0];
14839
+ var testLine = n > 0 ? line + this._wordDivider + words[n] : words[0];
14819
14840
  var testWidth = this._getTextMetricsWidth(context.measureText(testLine));
14820
14841
  if (testWidth > width && n > 0) {
14821
14842
  lines.push({ text: line, width: lineWidth });
@@ -14947,6 +14968,9 @@ var TextBlock = /** @class */ (function (_super) {
14947
14968
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
14948
14969
  (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
14949
14970
  ], TextBlock.prototype, "outlineColor", null);
14971
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
14972
+ (0,core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.serialize)()
14973
+ ], TextBlock.prototype, "wordDivider", null);
14950
14974
  return TextBlock;
14951
14975
  }(_control__WEBPACK_IMPORTED_MODULE_3__.Control));
14952
14976