Fixed center align in LineEdit
This commit is contained in:
parent
99a464ceb4
commit
b6b2ec7b77
1 changed files with 8 additions and 2 deletions
|
@ -601,7 +601,10 @@ void LineEdit::_notification(int p_what) {
|
||||||
} break;
|
} break;
|
||||||
case ALIGN_CENTER: {
|
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;
|
} break;
|
||||||
case ALIGN_RIGHT: {
|
case ALIGN_RIGHT: {
|
||||||
|
|
||||||
|
@ -846,7 +849,10 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) {
|
||||||
} break;
|
} break;
|
||||||
case ALIGN_CENTER: {
|
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;
|
} break;
|
||||||
case ALIGN_RIGHT: {
|
case ALIGN_RIGHT: {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue