diff options
| author | Paulb23 | 2016-06-07 16:59:16 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2016-06-25 00:22:36 +0200 |
| commit | afbc9d550f11598c85ba8657ad7ce932d80cd021 (patch) | |
| tree | 63a0646a72d846ef748150d5b4edcb1abb093dc6 /scene/gui/text_edit.cpp | |
| parent | d16375d00516917cb723c68934fe472e114ac036 (diff) | |
| download | godot-afbc9d550f11598c85ba8657ad7ce932d80cd021.tar.gz godot-afbc9d550f11598c85ba8657ad7ce932d80cd021.tar.zst godot-afbc9d550f11598c85ba8657ad7ce932d80cd021.zip | |
Improved breakpoint marker position, and scales with font size
(cherry picked from commit d66b034bd1557bb8a3b8e29a1fa64b10b94e408c)
Diffstat (limited to 'scene/gui/text_edit.cpp')
| -rw-r--r-- | scene/gui/text_edit.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index f75e986a9..f717a39f8 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -420,6 +420,7 @@ void TextEdit::_notification(int p_what) { case NOTIFICATION_DRAW: { if (draw_breakpoint_gutter) { + breakpoint_gutter_width = (get_row_height() * 55) / 100; cache.breakpoint_gutter_width = breakpoint_gutter_width; } else { cache.breakpoint_gutter_width = 0; @@ -716,10 +717,12 @@ void TextEdit::_notification(int p_what) { // draw breakpoint marker if (text.is_breakpoint(line)) { if (draw_breakpoint_gutter) { - int vertical_gap = cache.breakpoint_gutter_width / 2; - int marker_size = cache.breakpoint_gutter_width - vertical_gap; + int vertical_gap = (get_row_height() * 40) / 100; + int horizontal_gap = (cache.breakpoint_gutter_width * 30) / 100; + int marker_height = get_row_height() - (vertical_gap * 2); + int marker_width = cache.breakpoint_gutter_width - (horizontal_gap * 2); // no transparency on marker - VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cache.style_normal->get_margin(MARGIN_LEFT) + 1, ofs_y + vertical_gap ,marker_size, marker_size),Color(cache.breakpoint_color.r, cache.breakpoint_color.g, cache.breakpoint_color.b)); + VisualServer::get_singleton()->canvas_item_add_rect(ci,Rect2(cache.style_normal->get_margin(MARGIN_LEFT) + horizontal_gap - 2, ofs_y + vertical_gap ,marker_width, marker_height),Color(cache.breakpoint_color.r, cache.breakpoint_color.g, cache.breakpoint_color.b)); } } |
