summaryrefslogtreecommitdiffstats
path: root/editor/plugins/spatial_editor_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/spatial_editor_plugin.cpp')
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index fc72f25b04..66663d0cd9 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -2348,23 +2348,6 @@ void SpatialEditorViewport::_notification(int p_what) {
}
}
-// TODO That should be part of the drawing API...
-static void stroke_rect(CanvasItem &ci, Rect2 rect, Color color, real_t width = 1.0) {
-
- // a---b
- // | |
- // c---d
- Vector2 a(rect.position);
- Vector2 b(rect.position.x + rect.size.x, rect.position.y);
- Vector2 c(rect.position.x, rect.position.y + rect.size.y);
- Vector2 d(rect.position + rect.size);
-
- ci.draw_line(a, b, color, width);
- ci.draw_line(b, d, color, width);
- ci.draw_line(d, c, color, width);
- ci.draw_line(c, a, color, width);
-}
-
static void draw_indicator_bar(Control &surface, real_t fill, Ref<Texture> icon) {
// Adjust bar size from control height
@@ -2379,7 +2362,7 @@ static void draw_indicator_bar(Control &surface, real_t fill, Ref<Texture> icon)
// Draw both neutral dark and bright colors to account this
surface.draw_rect(r, Color(1, 1, 1, 0.2));
surface.draw_rect(Rect2(r.position.x, r.position.y + r.size.y - sy, r.size.x, sy), Color(1, 1, 1, 0.6));
- stroke_rect(surface, r.grow(1), Color(0, 0, 0, 0.7));
+ surface.draw_rect(r.grow(1), Color(0, 0, 0, 0.7), false, Math::round(EDSCALE));
Vector2 icon_size = icon->get_size();
Vector2 icon_pos = Vector2(r.position.x - (icon_size.x - r.size.x) / 2, r.position.y + r.size.y + 2);
@@ -2460,7 +2443,7 @@ void SpatialEditorViewport::_draw() {
draw_rect = Rect2(Vector2(), s).clip(draw_rect);
- stroke_rect(*surface, draw_rect, Color(0.6, 0.6, 0.1, 0.5), 2.0);
+ surface->draw_rect(draw_rect, Color(0.6, 0.6, 0.1, 0.5), false, Math::round(2 * EDSCALE));
} else {