Browse Source

More xxxInPixels properties

David Catuhe 7 years ago
parent
commit
d647bbe8b5

File diff suppressed because it is too large
+ 3484 - 3484
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 3484 - 3484
dist/preview release/babylon.module.d.ts


File diff suppressed because it is too large
+ 5755 - 5755
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


File diff suppressed because it is too large
+ 5755 - 5755
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


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

@@ -149,7 +149,7 @@ declare module BABYLON.GUI {
         protected _horizontalAlignment: number;
         protected _horizontalAlignment: number;
         protected _verticalAlignment: number;
         protected _verticalAlignment: number;
         private _isDirty;
         private _isDirty;
-        private _cachedParentMeasure;
+        protected _cachedParentMeasure: Measure;
         private _paddingLeft;
         private _paddingLeft;
         private _paddingRight;
         private _paddingRight;
         private _paddingTop;
         private _paddingTop;
@@ -433,7 +433,9 @@ declare module BABYLON.GUI {
         borderColor: string;
         borderColor: string;
         background: string;
         background: string;
         barOffset: string | number;
         barOffset: string | number;
+        readonly barOffsetInPixels: number;
         thumbWidth: string | number;
         thumbWidth: string | number;
+        readonly thumbWidthInPixels: number;
         minimum: number;
         minimum: number;
         maximum: number;
         maximum: number;
         value: number;
         value: number;
@@ -638,7 +640,9 @@ declare module BABYLON.GUI {
         onFocusObservable: Observable<InputText>;
         onFocusObservable: Observable<InputText>;
         onBlurObservable: Observable<InputText>;
         onBlurObservable: Observable<InputText>;
         maxWidth: string | number;
         maxWidth: string | number;
+        readonly maxWidthInPixels: number;
         margin: string;
         margin: string;
+        readonly marginInPixels: number;
         autoStretchWidth: boolean;
         autoStretchWidth: boolean;
         thickness: number;
         thickness: number;
         focusedBackground: string;
         focusedBackground: string;

+ 28 - 0
dist/preview release/gui/babylon.gui.js

@@ -2522,6 +2522,13 @@ var BABYLON;
                 enumerable: true,
                 enumerable: true,
                 configurable: true
                 configurable: true
             });
             });
+            Object.defineProperty(Slider.prototype, "barOffsetInPixels", {
+                get: function () {
+                    return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width);
+                },
+                enumerable: true,
+                configurable: true
+            });
             Object.defineProperty(Slider.prototype, "thumbWidth", {
             Object.defineProperty(Slider.prototype, "thumbWidth", {
                 get: function () {
                 get: function () {
                     return this._thumbWidth.toString(this._host);
                     return this._thumbWidth.toString(this._host);
@@ -2537,6 +2544,13 @@ var BABYLON;
                 enumerable: true,
                 enumerable: true,
                 configurable: true
                 configurable: true
             });
             });
+            Object.defineProperty(Slider.prototype, "thumbWidthInPixels", {
+                get: function () {
+                    return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
+                },
+                enumerable: true,
+                configurable: true
+            });
             Object.defineProperty(Slider.prototype, "minimum", {
             Object.defineProperty(Slider.prototype, "minimum", {
                 get: function () {
                 get: function () {
                     return this._minimum;
                     return this._minimum;
@@ -3831,6 +3845,13 @@ var BABYLON;
                 enumerable: true,
                 enumerable: true,
                 configurable: true
                 configurable: true
             });
             });
+            Object.defineProperty(InputText.prototype, "maxWidthInPixels", {
+                get: function () {
+                    return this._maxWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
+                },
+                enumerable: true,
+                configurable: true
+            });
             Object.defineProperty(InputText.prototype, "margin", {
             Object.defineProperty(InputText.prototype, "margin", {
                 get: function () {
                 get: function () {
                     return this._margin.toString(this._host);
                     return this._margin.toString(this._host);
@@ -3846,6 +3867,13 @@ var BABYLON;
                 enumerable: true,
                 enumerable: true,
                 configurable: true
                 configurable: true
             });
             });
+            Object.defineProperty(InputText.prototype, "marginInPixels", {
+                get: function () {
+                    return this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width);
+                },
+                enumerable: true,
+                configurable: true
+            });
             Object.defineProperty(InputText.prototype, "autoStretchWidth", {
             Object.defineProperty(InputText.prototype, "autoStretchWidth", {
                 get: function () {
                 get: function () {
                     return this._autoStretchWidth;
                     return this._autoStretchWidth;

File diff suppressed because it is too large
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


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

@@ -154,7 +154,7 @@ declare module BABYLON.GUI {
         protected _horizontalAlignment: number;
         protected _horizontalAlignment: number;
         protected _verticalAlignment: number;
         protected _verticalAlignment: number;
         private _isDirty;
         private _isDirty;
-        private _cachedParentMeasure;
+        protected _cachedParentMeasure: Measure;
         private _paddingLeft;
         private _paddingLeft;
         private _paddingRight;
         private _paddingRight;
         private _paddingTop;
         private _paddingTop;
@@ -438,7 +438,9 @@ declare module BABYLON.GUI {
         borderColor: string;
         borderColor: string;
         background: string;
         background: string;
         barOffset: string | number;
         barOffset: string | number;
+        readonly barOffsetInPixels: number;
         thumbWidth: string | number;
         thumbWidth: string | number;
+        readonly thumbWidthInPixels: number;
         minimum: number;
         minimum: number;
         maximum: number;
         maximum: number;
         value: number;
         value: number;
@@ -643,7 +645,9 @@ declare module BABYLON.GUI {
         onFocusObservable: Observable<InputText>;
         onFocusObservable: Observable<InputText>;
         onBlurObservable: Observable<InputText>;
         onBlurObservable: Observable<InputText>;
         maxWidth: string | number;
         maxWidth: string | number;
+        readonly maxWidthInPixels: number;
         margin: string;
         margin: string;
+        readonly marginInPixels: number;
         autoStretchWidth: boolean;
         autoStretchWidth: boolean;
         thickness: number;
         thickness: number;
         focusedBackground: string;
         focusedBackground: string;

+ 1 - 1
gui/src/controls/control.ts

@@ -20,7 +20,7 @@ module BABYLON.GUI {
         protected _horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;
         protected _horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;
         protected _verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;
         protected _verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;
         private _isDirty = true;
         private _isDirty = true;
-        private _cachedParentMeasure = Measure.Empty();
+        protected _cachedParentMeasure = Measure.Empty();
         private _paddingLeft = new ValueAndUnit(0);
         private _paddingLeft = new ValueAndUnit(0);
         private _paddingRight = new ValueAndUnit(0);
         private _paddingRight = new ValueAndUnit(0);
         private _paddingTop = new ValueAndUnit(0);
         private _paddingTop = new ValueAndUnit(0);

+ 8 - 0
gui/src/controls/inputText.ts

@@ -27,6 +27,10 @@ module BABYLON.GUI {
             return this._maxWidth.toString(this._host);
             return this._maxWidth.toString(this._host);
         }
         }
 
 
+        public get maxWidthInPixels(): number  {
+            return this._maxWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
+        }             
+
         public set maxWidth(value: string | number ) {
         public set maxWidth(value: string | number ) {
             if (this._maxWidth.toString(this._host) === value) {
             if (this._maxWidth.toString(this._host) === value) {
                 return;
                 return;
@@ -41,6 +45,10 @@ module BABYLON.GUI {
             return this._margin.toString(this._host);
             return this._margin.toString(this._host);
         }
         }
 
 
+        public get marginInPixels(): number  {
+            return this._margin.getValueInPixel(this._host, this._cachedParentMeasure.width);
+        }            
+
         public set margin(value: string) {
         public set margin(value: string) {
             if (this._margin.toString(this._host) === value) {
             if (this._margin.toString(this._host) === value) {
                 return;
                 return;

+ 8 - 0
gui/src/controls/slider.ts

@@ -42,6 +42,10 @@ module BABYLON.GUI {
             return this._barOffset.toString(this._host);
             return this._barOffset.toString(this._host);
         }
         }
 
 
+        public get barOffsetInPixels(): number  {
+            return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width);
+        }            
+
         public set barOffset(value: string | number ) {
         public set barOffset(value: string | number ) {
             if (this._barOffset.toString(this._host) === value) {
             if (this._barOffset.toString(this._host) === value) {
                 return;
                 return;
@@ -56,6 +60,10 @@ module BABYLON.GUI {
             return this._thumbWidth.toString(this._host);
             return this._thumbWidth.toString(this._host);
         }
         }
 
 
+        public get thumbWidthInPixels(): number  {
+            return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
+        }          
+
         public set thumbWidth(value: string | number ) {
         public set thumbWidth(value: string | number ) {
             if (this._thumbWidth.toString(this._host) === value) {
             if (this._thumbWidth.toString(this._host) === value) {
                 return;
                 return;