summaryrefslogtreecommitdiffstats
path: root/editor/plugins/canvas_item_editor_plugin.cpp
diff options
context:
space:
mode:
authorAnilforextra <anilforextra@gmail.com>2021-09-06 12:17:50 +0545
committerAnilforextra <anilforextra@gmail.com>2021-09-07 08:30:26 +0545
commita1f616dcfc9b4efa08a5e69e1b979ea7911dc1f8 (patch)
treec4e66098d479a7fe22ca4fcc89a211fdd6ec69c8 /editor/plugins/canvas_item_editor_plugin.cpp
parentc97afc033f720a68b3ea8dabb2956d836d13613e (diff)
downloadredot-engine-a1f616dcfc9b4efa08a5e69e1b979ea7911dc1f8.tar.gz
Use builtin Vector2 functions for calculation of angles.
.
Diffstat (limited to 'editor/plugins/canvas_item_editor_plugin.cpp')
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index d96cc1cd18..a41ca359aa 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -2927,7 +2927,7 @@ void CanvasItemEditor::_draw_ruler_tool() {
viewport->draw_string(font, text_pos, TS->format_number(vformat("%.1f px", length_vector.length())), HALIGN_LEFT, -1, font_size, font_color, outline_size, outline_color);
if (draw_secondary_lines) {
- const real_t horizontal_angle_rad = atan2(length_vector.y, length_vector.x);
+ const real_t horizontal_angle_rad = length_vector.angle();
const real_t vertical_angle_rad = Math_PI / 2.0 - horizontal_angle_rad;
const int horizontal_angle = round(180 * horizontal_angle_rad / Math_PI);
const int vertical_angle = round(180 * vertical_angle_rad / Math_PI);