Browse Source

Fix TextEdit caret drawn when outside the visible region

Ignacio Etcheverry 9 năm trước cách đây
mục cha
commit
02d1ef8ca6
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      scene/gui/text_edit.cpp

+ 1 - 1
scene/gui/text_edit.cpp

@@ -839,7 +839,7 @@ void TextEdit::_notification(int p_what) {
 					
 				}
 				
-				if (cursor.column==str.length() && cursor.line==line) {
+				if (cursor.column==str.length() && cursor.line==line && (char_ofs+char_margin)>=xmargin_beg) {
 					
 					cursor_pos=Point2i( char_ofs+char_margin, ofs_y );
 					VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cursor_pos, Size2i(1,get_row_height())),cache.font_color);