diff options
author | sanikoyes <sanikoyes@163.com> | 2016-06-04 18:10:11 +0800 |
---|---|---|
committer | sanikoyes <sanikoyes@163.com> | 2016-06-04 18:10:11 +0800 |
commit | 5f7b42cb874764b9e23724ed4a99c1b165b84f8a (patch) | |
tree | 413d7b5953b1e77f854bfd1651a1008bfe8980ce /scene/gui/line_edit.cpp | |
parent | f32f4671542839495c5fbf18f3460eae8d0499f2 (diff) |
fix line_edit&label get min size bug
fix line_edit draw char(x ofs_max)
Diffstat (limited to 'scene/gui/line_edit.cpp')
-rw-r--r-- | scene/gui/line_edit.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 14dac454bd..b8fca79e36 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -454,7 +454,7 @@ void LineEdit::_notification(int p_what) { } break; } - int ofs_max=width-style->get_minimum_size().width; + int ofs_max=width-style->get_minimum_size().width+x_ofs; int char_ofs=window_pos; int y_area=height-style->get_minimum_size().height; @@ -799,8 +799,7 @@ Size2 LineEdit::get_minimum_size() const { Ref<Font> font=get_font("font"); Size2 min=style->get_minimum_size(); - min.height+=font->get_height(); - min.width+=get_constant("minimum_spaces")*font->get_char_size(' ').x; + min+=font->get_string_size(this->text); return min; } |