浏览代码

Canvas2D: remove warning when using trackedNode

nockawa 8 年之前
父节点
当前提交
2a807f6146
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      canvas2D/src/Engine/babylon.prim2dBase.ts

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

@@ -3631,8 +3631,10 @@
                 return false;
             }
             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;
         }