From d8177049417b58d0ea4c7ab7500fb1bc1bb67ad7 Mon Sep 17 00:00:00 2001 From: shmyga Date: Fri, 28 Feb 2014 17:07:02 +0400 Subject: [PATCH] fixes --- haxework/gui/layout/DefaultLayout.hx | 2 +- haxework/gui/utils/DrawUtil.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/haxework/gui/layout/DefaultLayout.hx b/haxework/gui/layout/DefaultLayout.hx index eb9fc23..fb753ed 100755 --- a/haxework/gui/layout/DefaultLayout.hx +++ b/haxework/gui/layout/DefaultLayout.hx @@ -66,7 +66,7 @@ class DefaultLayout implements ILayout { case VAlign.TOP: view.y = group.topPadding + view.topMargin; case VAlign.MIDDLE: - view.y = (group.height - view.height) / 2 + (group.topPadding - group.topPadding) + (view.bottomMargin - view.bottomMargin); + view.y = (group.height - view.height) / 2 + (group.topPadding - group.bottomPadding) + (view.topMargin - view.bottomMargin); case VAlign.BOTTOM: view.y = group.height - view.height - group.bottomPadding - view.bottomMargin; case VAlign.NONE: diff --git a/haxework/gui/utils/DrawUtil.hx b/haxework/gui/utils/DrawUtil.hx index 02d8e0e..07227ca 100755 --- a/haxework/gui/utils/DrawUtil.hx +++ b/haxework/gui/utils/DrawUtil.hx @@ -46,7 +46,7 @@ class DrawUtil { var dx:Float = (rect.width - image.width * s) / 2; var dy:Float = (rect.height - image.height * s) / 2; m.translate(dx, dy); - graphics.beginBitmapFill(image, m, false, false); + graphics.beginBitmapFill(image, m, false, true); rect.x = Math.max(rect.x, m.tx); rect.y = Math.max(rect.y, m.ty); rect.width = Math.min(rect.width, image.width * s);