Procházet zdrojové kódy

Add Textblock lineSpacing property getter

Carlos Landeras Martínez před 7 roky
rodič
revize
40336dad0c

+ 1 - 1
dist/preview release/gui/babylon.gui.d.ts

@@ -521,11 +521,11 @@ declare module BABYLON.GUI {
         */
         onTextChangedObservable: Observable<TextBlock>;
         resizeToFit: boolean;
-        lineSpacing: number;
         textWrapping: boolean;
         text: string;
         textHorizontalAlignment: number;
         textVerticalAlignment: number;
+        lineSpacing: number;
         constructor(name?: string | undefined, text?: string);
         protected _getTypeName(): string;
         private _drawText(text, textWidth, y, context);

+ 10 - 7
dist/preview release/gui/babylon.gui.js

@@ -3183,13 +3183,6 @@ var BABYLON;
                 enumerable: true,
                 configurable: true
             });
-            Object.defineProperty(TextBlock.prototype, "lineSpacing", {
-                set: function (value) {
-                    this._lineSpacing = value;
-                },
-                enumerable: true,
-                configurable: true
-            });
             Object.defineProperty(TextBlock.prototype, "textWrapping", {
                 get: function () {
                     return this._textWrapping;
@@ -3247,6 +3240,16 @@ var BABYLON;
                 enumerable: true,
                 configurable: true
             });
+            Object.defineProperty(TextBlock.prototype, "lineSpacing", {
+                get: function () {
+                    return this._lineSpacing;
+                },
+                set: function (value) {
+                    this._lineSpacing = value;
+                },
+                enumerable: true,
+                configurable: true
+            });
             TextBlock.prototype._getTypeName = function () {
                 return "TextBlock";
             };

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


+ 1 - 1
dist/preview release/gui/babylon.gui.module.d.ts

@@ -526,11 +526,11 @@ declare module BABYLON.GUI {
         */
         onTextChangedObservable: Observable<TextBlock>;
         resizeToFit: boolean;
-        lineSpacing: number;
         textWrapping: boolean;
         text: string;
         textHorizontalAlignment: number;
         textVerticalAlignment: number;
+        lineSpacing: number;
         constructor(name?: string | undefined, text?: string);
         protected _getTypeName(): string;
         private _drawText(text, textWidth, y, context);

+ 10 - 6
gui/src/controls/textBlock.ts

@@ -20,10 +20,6 @@ module BABYLON.GUI {
             return this._resizeToFit;
         }
 
-        public set lineSpacing(value: number) {
-            this._lineSpacing = value;
-        }
-
         set resizeToFit(value: boolean) {
             this._resizeToFit = value;
 
@@ -85,6 +81,14 @@ module BABYLON.GUI {
             this._markAsDirty();
         }
 
+        public set lineSpacing(value: number) {
+            this._lineSpacing = value;
+        }
+
+        public get lineSpacing(): number {
+            return this._lineSpacing;
+        }
+
         constructor(public name?: string, text: string = "") {
             super(name);
 
@@ -195,12 +199,12 @@ module BABYLON.GUI {
 
             rootY += this._currentMeasure.top;
 
-            var maxLineWidth: number = 0;            
+            var maxLineWidth: number = 0;
 
             for (let i = 0; i < this._lines.length; i++) {
                 const line = this._lines[i];
 
-                if (i !== 0 && this._lineSpacing > 0 ){
+                if (i !== 0 && this._lineSpacing > 0) {
                     rootY += this._lineSpacing;
                 }