diff --git a/haxe/ui/backend/TextDisplayImpl.hx b/haxe/ui/backend/TextDisplayImpl.hx index 0bd4879..2a90d6e 100644 --- a/haxe/ui/backend/TextDisplayImpl.hx +++ b/haxe/ui/backend/TextDisplayImpl.hx @@ -129,7 +129,9 @@ class TextDisplayImpl extends TextBase { private override function validateDisplay() { if (autoWidth == false) { sprite.maxWidth = _width != 0 ? _width : _textWidth; - } else if (sprite.textAlign == h2d.Text.Align.Center) { + }else if (sprite.textAlign == h2d.Text.Align.Right){ + sprite.x =_width; + }else if (sprite.textAlign == h2d.Text.Align.Center) { sprite.x = (_left) + (_width / 2); } } diff --git a/haxe/ui/backend/TextInputImpl.hx b/haxe/ui/backend/TextInputImpl.hx index ba4067a..dd07972 100644 --- a/haxe/ui/backend/TextInputImpl.hx +++ b/haxe/ui/backend/TextInputImpl.hx @@ -29,9 +29,9 @@ class TextInputImpl extends TextDisplayImpl { // we're actually going to override this function so that it always returns // h2d.Text.Align.Left - this is because heaps text input doesnt seem to like // center aligned text (or right aligned), for now will simply turn it off - private override function getAlign(align:String):h2d.Text.Align { + /*private override function getAlign(align:String):h2d.Text.Align { return h2d.Text.Align.Left; - } + }*/ public override function focus() { Toolkit.callLater(function() {