diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-01-15 15:58:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 15:58:32 +0100 |
commit | d1f2644cfacbe1928b4480d193808b8c0bedaed9 (patch) | |
tree | 505bca3901a039eec118f8ebbeff13d6fbbd92a4 | |
parent | 9a2f848855299623e601b7426d35b6fbd1ae9e1c (diff) | |
parent | 656aba1273e0b24b58fb2e00dd23ca9131115406 (diff) |
Merge pull request #45164 from Calinou/texture-region-editor-line-background
Draw a "background" line behind the dashed line in TextureRegion editor
-rw-r--r-- | editor/plugins/texture_region_editor_plugin.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 53e127d4c8..61e0cc281d 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -42,8 +42,21 @@ void draw_margin_line(Control *edit_draw, Vector2 from, Vector2 to) { Vector2 line = (to - from).normalized() * 10; + + // Draw a translucent background line to make the foreground line visible on any background. + edit_draw->draw_line( + from, + to, + EditorNode::get_singleton()->get_theme_base()->get_theme_color("mono_color", "Editor").inverted() * Color(1, 1, 1, 0.5), + Math::round(2 * EDSCALE)); + while ((to - from).length_squared() > 200) { - edit_draw->draw_line(from, from + line, EditorNode::get_singleton()->get_theme_base()->get_theme_color("mono_color", "Editor"), 2); + edit_draw->draw_line( + from, + from + line, + EditorNode::get_singleton()->get_theme_base()->get_theme_color("mono_color", "Editor"), + Math::round(2 * EDSCALE)); + from += line * 2; } } |