Преглед изворни кода

Removed slider.foreground to use color property instead

David Catuhe пре 8 година
родитељ
комит
517f9b71d4

+ 0 - 2
dist/preview release/gui/babylon.gui.d.ts

@@ -365,12 +365,10 @@ declare module BABYLON.GUI {
         private _maximum;
         private _value;
         private _background;
-        private _foreground;
         private _borderColor;
         private _barOffset;
         onValueChangedObservable: Observable<number>;
         borderColor: string;
-        foreground: string;
         background: string;
         barOffset: string | number;
         thumbWidth: string | number;

+ 1 - 16
dist/preview release/gui/babylon.gui.js

@@ -2028,7 +2028,6 @@ var BABYLON;
                 _this._maximum = 100;
                 _this._value = 50;
                 _this._background = "black";
-                _this._foreground = "green";
                 _this._borderColor = "white";
                 _this._barOffset = new GUI.ValueAndUnit(5, GUI.ValueAndUnit.UNITMODE_PIXEL, false);
                 _this.onValueChangedObservable = new BABYLON.Observable();
@@ -2051,20 +2050,6 @@ var BABYLON;
                 enumerable: true,
                 configurable: true
             });
-            Object.defineProperty(Slider.prototype, "foreground", {
-                get: function () {
-                    return this._foreground;
-                },
-                set: function (value) {
-                    if (this._foreground === value) {
-                        return;
-                    }
-                    this._foreground = value;
-                    this._markAsDirty();
-                },
-                enumerable: true,
-                configurable: true
-            });
             Object.defineProperty(Slider.prototype, "background", {
                 get: function () {
                     return this._background;
@@ -2180,7 +2165,7 @@ var BABYLON;
                     // Bar
                     context.fillStyle = this._background;
                     context.fillRect(left, this._currentMeasure.top + effectiveBarOffset, width, this._currentMeasure.height - effectiveBarOffset * 2);
-                    context.fillStyle = this._foreground;
+                    context.fillStyle = this.color;
                     context.fillRect(left, this._currentMeasure.top + effectiveBarOffset, thumbPosition, this._currentMeasure.height - effectiveBarOffset * 2);
                     // Thumb
                     context.fillRect(left + thumbPosition - effectiveThumbWidth / 2, this._currentMeasure.top, effectiveThumbWidth, this._currentMeasure.height);

Разлика између датотеке није приказан због своје велике величине
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


+ 1 - 15
gui/src/controls/slider.ts

@@ -9,7 +9,6 @@ module BABYLON.GUI {
         private _maximum = 100;
         private _value = 50;
         private _background = "black";   
-        private _foreground = "green";
         private _borderColor = "white";
         private _barOffset = new ValueAndUnit(5, ValueAndUnit.UNITMODE_PIXEL, false);
 
@@ -28,19 +27,6 @@ module BABYLON.GUI {
             this._markAsDirty();
         }  
 
-        public get foreground(): string {
-            return this._foreground;
-        }
-
-        public set foreground(value: string) {
-            if (this._foreground === value) {
-                return;
-            }
-
-            this._foreground = value;
-            this._markAsDirty();
-        }          
-
         public get background(): string {
             return this._background;
         }
@@ -164,7 +150,7 @@ module BABYLON.GUI {
                 context.fillStyle = this._background;
                 context.fillRect(left, this._currentMeasure.top + effectiveBarOffset, width, this._currentMeasure.height - effectiveBarOffset * 2);
 
-                context.fillStyle = this._foreground;
+                context.fillStyle = this.color;
                 context.fillRect(left, this._currentMeasure.top + effectiveBarOffset, thumbPosition, this._currentMeasure.height - effectiveBarOffset * 2);
 
                 // Thumb