Browse Source

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe 8 years ago
parent
commit
37f5f96f8d

+ 33 - 26
canvas2D/src/Engine/babylon.prim2dBase.ts

@@ -442,38 +442,45 @@
          */
         fromString(value: string) {
             let m = value.trim().split(",");
-            if (m.length === 1) {
-                this.setHorizontal(m[0]);
-                this.setVertical(m[0]);
-            } else {
-                for (let v of m) {
-                    v = v.toLocaleLowerCase().trim();
+            
+            var hset = false;
+            var vset = false;
 
-                    // Horizontal
-                    let i = v.indexOf("h:");
-                    if (i === -1) {
-                        i = v.indexOf("horizontal:");
-                    }
+            for (let v of m) {
+                v = v.toLocaleLowerCase().trim();
 
-                    if (i !== -1) {
-                        v = v.substr(v.indexOf(":") + 1);
-                        this.setHorizontal(v);
-                        continue;
-                    }
+                // Horizontal
+                let i = v.indexOf("h:");
+                if (i === -1) {
+                    i = v.indexOf("horizontal:");
+                }
 
-                    // Vertical
-                    i = v.indexOf("v:");
-                    if (i === -1) {
-                        i = v.indexOf("vertical:");
-                    }
+                if (i !== -1) {
+                    v = v.substr(v.indexOf(":") + 1);
+                    this.setHorizontal(v);
+                    hset = true;
+                    continue;
+                }
 
-                    if (i !== -1) {
-                        v = v.substr(v.indexOf(":") + 1);
-                        this.setVertical(v);
-                        continue;
-                    }
+                // Vertical
+                i = v.indexOf("v:");
+                if (i === -1) {
+                    i = v.indexOf("vertical:");
+                }
+
+                if (i !== -1) {
+                    v = v.substr(v.indexOf(":") + 1);
+                    this.setVertical(v);
+                    vset = true;
+                    continue;
                 }
             }
+
+            if (!hset && !vset && m.length === 1) {
+                this.setHorizontal(m[0]);
+                this.setVertical(m[0]);
+            }
+
         }
 
         copyFrom(pa: PrimitiveAlignment) {

File diff suppressed because it is too large
+ 471 - 460
dist/preview release/customConfigurations/minimalViewer/babylon.d.ts


File diff suppressed because it is too large
+ 20 - 20
dist/preview release/customConfigurations/minimalViewer/babylon.js


File diff suppressed because it is too large
+ 62 - 38
dist/preview release/customConfigurations/minimalViewer/babylon.max.js


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


+ 9 - 0
src/babylon.engine.ts

@@ -245,6 +245,7 @@
         private static _ALPHA_MAXIMIZED = 5;
         private static _ALPHA_ONEONE = 6;
         private static _ALPHA_PREMULTIPLIED = 7;
+        private static _ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
 
         private static _DELAYLOADSTATE_NONE = 0;
         private static _DELAYLOADSTATE_LOADED = 1;
@@ -376,6 +377,10 @@
             return Engine._ALPHA_PREMULTIPLIED;
         }
 
+        public static get ALPHA_PREMULTIPLIED_PORTERDUFF(): number {
+            return Engine._ALPHA_PREMULTIPLIED_PORTERDUFF;
+        }
+
         public static get DELAYLOADSTATE_NONE(): number {
             return Engine._DELAYLOADSTATE_NONE;
         }
@@ -2167,6 +2172,10 @@
                     this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE);
                     this._alphaState.alphaBlend = true;
                     break;
+                case Engine.ALPHA_PREMULTIPLIED_PORTERDUFF:
+                    this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);
+                    this._alphaState.alphaBlend = true;
+                    break;
                 case Engine.ALPHA_COMBINE:
                     this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE);
                     this._alphaState.alphaBlend = true;