diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/container.cpp | 1 | ||||
-rw-r--r-- | scene/gui/graph_edit.cpp | 10 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 11 |
3 files changed, 17 insertions, 5 deletions
diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index c58975d332..2579321773 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -95,6 +95,7 @@ void Container::_sort_children() { void Container::fit_child_in_rect(Control *p_child, const Rect2 &p_rect) { + ERR_FAIL_COND(!p_child); ERR_FAIL_COND(p_child->get_parent() != this); Size2 minsize = p_child->get_combined_minimum_size(); diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index b4e4f7125d..94c65b3e64 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -34,6 +34,10 @@ #include "core/os/keyboard.h" #include "scene/gui/box_container.h" +#ifdef TOOLS_ENABLED +#include "editor/editor_scale.h" +#endif + #define ZOOM_SCALE 1.2 #define MIN_ZOOM (((1 / ZOOM_SCALE) / ZOOM_SCALE) / ZOOM_SCALE) @@ -665,11 +669,15 @@ void GraphEdit::_draw_cos_line(CanvasItem *p_where, const Vector2 &p_from, const Vector<Color> colors; points.push_back(p_from); colors.push_back(p_color); - _bake_segment2d(points, colors, 0, 1, p_from, c1, p_to, c2, 0, 3, 9, 8, p_color, p_to_color, lines); + _bake_segment2d(points, colors, 0, 1, p_from, c1, p_to, c2, 0, 3, 9, 3, p_color, p_to_color, lines); points.push_back(p_to); colors.push_back(p_to_color); +#ifdef TOOLS_ENABLED + p_where->draw_polyline_colors(points, colors, Math::floor(2 * EDSCALE), true); +#else p_where->draw_polyline_colors(points, colors, 2, true); +#endif } void GraphEdit::_connections_layer_draw() { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 4607e55057..7577ee22ab 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -802,6 +802,7 @@ void TextEdit::_notification(int p_what) { } Point2 cursor_pos; + int cursor_insert_offset_y = 0; // get the highlighted words String highlighted_text = get_selection_text(); @@ -1111,7 +1112,8 @@ void TextEdit::_notification(int p_what) { cursor_pos.y += (get_row_height() - cache.font->get_height()) / 2; if (insert_mode) { - cursor_pos.y += (cache.font->get_height() - 3); + cursor_insert_offset_y = (cache.font->get_height() - 3); + cursor_pos.y += cursor_insert_offset_y; } int caret_w = (str[j] == '\t') ? cache.font->get_char_size(' ').width : char_w; @@ -1203,7 +1205,8 @@ void TextEdit::_notification(int p_what) { cursor_pos.y += (get_row_height() - cache.font->get_height()) / 2; if (insert_mode) { - cursor_pos.y += (cache.font->get_height() - 3); + cursor_insert_offset_y = cache.font->get_height() - 3; + cursor_pos.y += cursor_insert_offset_y; } if (ime_text.length() > 0) { int ofs = 0; @@ -1291,9 +1294,9 @@ void TextEdit::_notification(int p_what) { int th = h + csb->get_minimum_size().y; if (cursor_pos.y + get_row_height() + th > get_size().height) { - completion_rect.position.y = cursor_pos.y - th; + completion_rect.position.y = cursor_pos.y - th - (cache.line_spacing / 2.0f) - cursor_insert_offset_y; } else { - completion_rect.position.y = cursor_pos.y + get_row_height() + csb->get_offset().y - cache.font->get_height(); + completion_rect.position.y = cursor_pos.y + cache.font->get_height() + (cache.line_spacing / 2.0f) + csb->get_offset().y - cursor_insert_offset_y; completion_below = true; } |