Przeglądaj źródła

Merge pull request #1800 from nockawa/PictureAltasJSONLocal

Canvas2D: remove warning when using trackedNode
Loïc Baumann 8 lat temu
rodzic
commit
2a10f667e8

+ 4 - 2
canvas2D/src/Engine/babylon.prim2dBase.ts

@@ -3631,8 +3631,10 @@
                 return false;
                 return false;
             }
             }
             if (this._isFlagSet(SmartPropertyPrim.flagUsePositioning)) {
             if (this._isFlagSet(SmartPropertyPrim.flagUsePositioning)) {
-                console.log(`You can't set the position/x/y of ${this.id} properties while positioning engine is used (margin, margin alignment and/or padding are set`);
-                return false;
+                if (<any>this instanceof Group2D && (<Group2D><any>this).trackedNode == null) {
+                    console.log(`You can't set the position/x/y of ${this.id} properties while positioning engine is used (margin, margin alignment and/or padding are set`);
+                    return false;
+                }
             }
             }
             return true;
             return true;
         }
         }

+ 4 - 2
dist/preview release/canvas2D/babylon.canvas2d.js

@@ -8780,8 +8780,10 @@ var BABYLON;
                 return false;
                 return false;
             }
             }
             if (this._isFlagSet(BABYLON.SmartPropertyPrim.flagUsePositioning)) {
             if (this._isFlagSet(BABYLON.SmartPropertyPrim.flagUsePositioning)) {
-                console.log("You can't set the position/x/y of " + this.id + " properties while positioning engine is used (margin, margin alignment and/or padding are set");
-                return false;
+                if (this instanceof BABYLON.Group2D && this.trackedNode == null) {
+                    console.log("You can't set the position/x/y of " + this.id + " properties while positioning engine is used (margin, margin alignment and/or padding are set");
+                    return false;
+                }
             }
             }
             return true;
             return true;
         };
         };

Plik diff jest za duży
+ 3 - 3
dist/preview release/canvas2D/babylon.canvas2d.min.js