diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-09-07 08:25:58 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-09-07 08:26:10 +0300 |
commit | 3842694d4f9274d69c0697411e5956cfa35e5cc7 (patch) | |
tree | 3b0acb742ec1df1605586f7c44a13cb003aee1b9 /scene/gui/text_edit.cpp | |
parent | 8449592d92eaeef990f5502b419d491ee3eeb7a6 (diff) | |
download | redot-engine-3842694d4f9274d69c0697411e5956cfa35e5cc7.tar.gz |
Fix TextEdit placeholder with Inherited text direction.
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r-- | scene/gui/text_edit.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index cffd9604f6..1d5cee61a3 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2943,7 +2943,11 @@ void TextEdit::_update_placeholder() { placeholder_data_buf->clear(); placeholder_data_buf->set_width(text.get_width()); placeholder_data_buf->set_break_flags(text.get_brk_flags()); - placeholder_data_buf->set_direction((TextServer::Direction)text_direction); + if (text_direction == Control::TEXT_DIRECTION_INHERITED) { + placeholder_data_buf->set_direction(is_layout_rtl() ? TextServer::DIRECTION_RTL : TextServer::DIRECTION_LTR); + } else { + placeholder_data_buf->set_direction((TextServer::Direction)text_direction); + } placeholder_data_buf->set_preserve_control(draw_control_chars); placeholder_data_buf->add_string(placeholder_text, theme_cache.font, theme_cache.font_size, language); |