Skip to content

Commit

Permalink
Merge pull request #50 from hoseyjoe/master
Browse files Browse the repository at this point in the history
Fixes right aligned labels,buttons. Input fields start better but sti…
  • Loading branch information
ianharrigan authored Dec 9, 2024
2 parents 42797cb + f5a822a commit 396f1a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion haxe/ui/backend/TextDisplayImpl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
4 changes: 2 additions & 2 deletions haxe/ui/backend/TextInputImpl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 396f1a0

Please sign in to comment.