瀏覽代碼

Fixed minor issue with Alignment Computation

nockawa 8 年之前
父節點
當前提交
e43e445eb3
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      canvas2D/src/Engine/babylon.prim2dBase.ts

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

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