Browse Source

C2D: quick fix on position/x/y set when marginAlignment is not fetched yet

nockawa 8 years ago
parent
commit
0013aa0b9e

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

@@ -2037,7 +2037,7 @@
             //    return;
             //}
             if (this._checkUseMargin()) {
-                switch (this._marginAlignment.horizontal) {
+                switch (this.marginAlignment.horizontal) {
                     case PrimitiveAlignment.AlignLeft:
                     case PrimitiveAlignment.AlignStretch:
                     case PrimitiveAlignment.AlignCenter:
@@ -2047,7 +2047,7 @@
                         this.margin.rightPixels = value.x;
                         break;
                     }
-                switch (this._marginAlignment.vertical) {
+                switch (this.marginAlignment.vertical) {
                     case PrimitiveAlignment.AlignBottom:
                     case PrimitiveAlignment.AlignStretch:
                     case PrimitiveAlignment.AlignCenter:
@@ -2093,7 +2093,7 @@
                 throw new Error(`Can't set a null x in primitive ${this.id}, only the position can be turned to null`);
             }
             if (this._checkUseMargin()) {
-                switch (this._marginAlignment.horizontal) {
+                switch (this.marginAlignment.horizontal) {
                     case PrimitiveAlignment.AlignLeft:
                     case PrimitiveAlignment.AlignStretch:
                     case PrimitiveAlignment.AlignCenter:
@@ -2140,7 +2140,7 @@
                 throw new Error(`Can't set a null y in primitive ${this.id}, only the position can be turned to null`);
             }
             if (this._checkUseMargin()) {
-                switch (this._marginAlignment.vertical) {
+                switch (this.marginAlignment.vertical) {
                     case PrimitiveAlignment.AlignBottom:
                     case PrimitiveAlignment.AlignStretch:
                     case PrimitiveAlignment.AlignCenter:

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

@@ -7423,7 +7423,7 @@ var BABYLON;
                 //    return;
                 //}
                 if (this._checkUseMargin()) {
-                    switch (this._marginAlignment.horizontal) {
+                    switch (this.marginAlignment.horizontal) {
                         case PrimitiveAlignment.AlignLeft:
                         case PrimitiveAlignment.AlignStretch:
                         case PrimitiveAlignment.AlignCenter:
@@ -7433,7 +7433,7 @@ var BABYLON;
                             this.margin.rightPixels = value.x;
                             break;
                     }
-                    switch (this._marginAlignment.vertical) {
+                    switch (this.marginAlignment.vertical) {
                         case PrimitiveAlignment.AlignBottom:
                         case PrimitiveAlignment.AlignStretch:
                         case PrimitiveAlignment.AlignCenter:
@@ -7483,7 +7483,7 @@ var BABYLON;
                     throw new Error("Can't set a null x in primitive " + this.id + ", only the position can be turned to null");
                 }
                 if (this._checkUseMargin()) {
-                    switch (this._marginAlignment.horizontal) {
+                    switch (this.marginAlignment.horizontal) {
                         case PrimitiveAlignment.AlignLeft:
                         case PrimitiveAlignment.AlignStretch:
                         case PrimitiveAlignment.AlignCenter:
@@ -7530,7 +7530,7 @@ var BABYLON;
                     throw new Error("Can't set a null y in primitive " + this.id + ", only the position can be turned to null");
                 }
                 if (this._checkUseMargin()) {
-                    switch (this._marginAlignment.vertical) {
+                    switch (this.marginAlignment.vertical) {
                         case PrimitiveAlignment.AlignBottom:
                         case PrimitiveAlignment.AlignStretch:
                         case PrimitiveAlignment.AlignCenter:

File diff suppressed because it is too large
+ 6 - 6
dist/preview release/canvas2D/babylon.canvas2d.min.js