Browse Source

Fixed minor issue with Alignment Computation

nockawa 8 năm trước cách đây
mục cha
commit
e43e445eb3

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

@@ -1126,7 +1126,7 @@
                         if (computeLayoutArea) {
                         if (computeLayoutArea) {
                             dstArea.width += this.rightPixels;
                             dstArea.width += this.rightPixels;
                         }
                         }
-                        dstOffset.z = 0;
+                        dstOffset.z = this.rightPixels;
                         break;
                         break;
                     }
                     }
                 case PrimitiveAlignment.AlignStretch:
                 case PrimitiveAlignment.AlignStretch:
@@ -1144,7 +1144,7 @@
                             right = this.rightPixels;
                             right = this.rightPixels;
                         }
                         }
                         dstArea.width = sourceArea.width - (dstOffset.x + right);
                         dstArea.width = sourceArea.width - (dstOffset.x + right);
-                        dstOffset.z = 0;
+                        dstOffset.z = this.rightPixels;
                         break;
                         break;
                     }
                     }
                 case PrimitiveAlignment.AlignCenter:
                 case PrimitiveAlignment.AlignCenter:
@@ -1177,7 +1177,7 @@
                         if (computeLayoutArea) {
                         if (computeLayoutArea) {
                             dstArea.height += this.topPixels;
                             dstArea.height += this.topPixels;
                         }
                         }
-                        dstOffset.w = 0;
+                        dstOffset.w = this.topPixels;
                         break;
                         break;
 
 
                     }
                     }
@@ -1212,7 +1212,7 @@
                             top = this.topPixels;
                             top = this.topPixels;
                         }
                         }
                         dstArea.height = sourceArea.height - (dstOffset.y + top);
                         dstArea.height = sourceArea.height - (dstOffset.y + top);
-                        dstOffset.w = 0;
+                        dstOffset.w = this.topPixels;
                         break;
                         break;
                     }
                     }
                 case PrimitiveAlignment.AlignCenter:
                 case PrimitiveAlignment.AlignCenter: