summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorAndreas Haas <Hinsbart@users.noreply.github.com>2017-10-02 22:26:42 +0200
committerGitHub <noreply@github.com>2017-10-02 22:26:42 +0200
commitcb71a6d6faf2f42b7695e8fdb8f1c23d8b4ab34d (patch)
treeff2af1f4c7b4621b3a565665ccb25690e492d17c /scene/gui
parenta4cfec4e2152deb5fc3bceb4564ac3f194f50417 (diff)
parentb6b2ec7b7738512fa5edffe6b6a84b15e94ed33b (diff)
Merge pull request #11754 from magyar123/master
Fixed center align in LineEdit
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/line_edit.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 8ca487f2bd..ed8eff436c 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -601,7 +601,10 @@ void LineEdit::_notification(int p_what) {
} break;
case ALIGN_CENTER: {
- x_ofs = int(size.width - (cached_width)) / 2;
+ if (window_pos != 0)
+ x_ofs = style->get_offset().x;
+ else
+ x_ofs = int(size.width - (cached_width)) / 2;
} break;
case ALIGN_RIGHT: {
@@ -846,7 +849,10 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) {
} break;
case ALIGN_CENTER: {
- pixel_ofs = int(size.width - (cached_width)) / 2;
+ if (window_pos != 0)
+ pixel_ofs = int(style->get_offset().x);
+ else
+ pixel_ofs = int(size.width - (cached_width)) / 2;
} break;
case ALIGN_RIGHT: {