|
@@ -3160,7 +3160,7 @@ var BABYLON;
|
|
_this._textHorizontalAlignment = GUI.Control.HORIZONTAL_ALIGNMENT_CENTER;
|
|
_this._textHorizontalAlignment = GUI.Control.HORIZONTAL_ALIGNMENT_CENTER;
|
|
_this._textVerticalAlignment = GUI.Control.VERTICAL_ALIGNMENT_CENTER;
|
|
_this._textVerticalAlignment = GUI.Control.VERTICAL_ALIGNMENT_CENTER;
|
|
_this._resizeToFit = false;
|
|
_this._resizeToFit = false;
|
|
- _this._lineSpacing = 0;
|
|
|
|
|
|
+ _this._lineSpacing = new GUI.ValueAndUnit(0);
|
|
/**
|
|
/**
|
|
* An event triggered after the text is changed
|
|
* An event triggered after the text is changed
|
|
* @type {BABYLON.Observable}
|
|
* @type {BABYLON.Observable}
|
|
@@ -3242,10 +3242,12 @@ var BABYLON;
|
|
});
|
|
});
|
|
Object.defineProperty(TextBlock.prototype, "lineSpacing", {
|
|
Object.defineProperty(TextBlock.prototype, "lineSpacing", {
|
|
get: function () {
|
|
get: function () {
|
|
- return this._lineSpacing;
|
|
|
|
|
|
+ return this._lineSpacing.toString(this._host);
|
|
},
|
|
},
|
|
set: function (value) {
|
|
set: function (value) {
|
|
- this._lineSpacing = value;
|
|
|
|
|
|
+ if (this._lineSpacing.fromString(value)) {
|
|
|
|
+ this._markAsDirty();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
enumerable: true,
|
|
enumerable: true,
|
|
configurable: true
|
|
configurable: true
|
|
@@ -3346,8 +3348,13 @@ var BABYLON;
|
|
var maxLineWidth = 0;
|
|
var maxLineWidth = 0;
|
|
for (var i = 0; i < this._lines.length; i++) {
|
|
for (var i = 0; i < this._lines.length; i++) {
|
|
var line = this._lines[i];
|
|
var line = this._lines[i];
|
|
- if (i !== 0 && this._lineSpacing > 0) {
|
|
|
|
- rootY += this._lineSpacing;
|
|
|
|
|
|
+ if (i !== 0 && this._lineSpacing.internalValue !== 0) {
|
|
|
|
+ if (this._lineSpacing.isPixel) {
|
|
|
|
+ rootY += this._lineSpacing.getValue(this._host);
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ rootY = rootY + (this._lineSpacing.getValue(this._host) * this._height.getValueInPixel(this._host, this._cachedParentMeasure.height));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this._drawText(line.text, line.width, rootY, context);
|
|
this._drawText(line.text, line.width, rootY, context);
|
|
rootY += this._fontOffset.height;
|
|
rootY += this._fontOffset.height;
|