Merge pull request #89993 from Sauermann/fix-textedit-clip-contents

Make `TextEdit.clip_contents` more transparent to users
This commit is contained in:
Rémi Verschelde 2024-04-04 14:35:54 +02:00
commit 0df9c16d81
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 2 additions and 1 deletions

View File

@ -1132,6 +1132,7 @@
<member name="caret_type" type="int" setter="set_caret_type" getter="get_caret_type" enum="TextEdit.CaretType" default="0">
Set the type of caret to draw.
</member>
<member name="clip_contents" type="bool" setter="set_clip_contents" getter="is_clipping_contents" overrides="Control" default="true" />
<member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled" default="true">
If [code]true[/code], a right-click displays the context menu.
</member>

View File

@ -539,7 +539,6 @@ void TextEdit::_notification(int p_what) {
_update_scrollbars();
RID ci = get_canvas_item();
RenderingServer::get_singleton()->canvas_item_set_clip(get_canvas_item(), true);
int xmargin_beg = theme_cache.style_normal->get_margin(SIDE_LEFT) + gutters_width + gutter_padding;
int xmargin_end = size.width - theme_cache.style_normal->get_margin(SIDE_RIGHT);
@ -8022,5 +8021,6 @@ TextEdit::TextEdit(const String &p_placeholder) {
set_placeholder(p_placeholder);
set_clip_contents(true);
set_editable(true);
}