diff options
author | smix8 <52464204+smix8@users.noreply.github.com> | 2022-06-15 23:24:06 +0200 |
---|---|---|
committer | smix8 <52464204+smix8@users.noreply.github.com> | 2022-06-20 17:32:05 +0200 |
commit | e12e239ab4a9bb764105e3a0cde284f788cd59b3 (patch) | |
tree | e204537f08bd0285092dd35055a4263e3d27237e /scene/2d | |
parent | 421d8b716db25a7556d428b7bb210ce4d94caa0b (diff) | |
download | redot-engine-e12e239ab4a9bb764105e3a0cde284f788cd59b3.tar.gz |
Add Path2D/3D debug options
Add Path2D/3D debug options.
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/path_2d.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index ba90a275e6..8eb48ffb30 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -87,13 +87,13 @@ bool Path2D::_edit_is_selected_on_click(const Point2 &p_point, double p_toleranc void Path2D::_notification(int p_what) { switch (p_what) { - // Draw the curve if navigation debugging is enabled. + // Draw the curve if path debugging is enabled. case NOTIFICATION_DRAW: { if (!curve.is_valid()) { break; } - if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_navigation_hint()) { + if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_paths_hint()) { return; } @@ -102,12 +102,10 @@ void Path2D::_notification(int p_what) { } #ifdef TOOLS_ENABLED - const real_t line_width = 2 * EDSCALE; + const real_t line_width = get_tree()->get_debug_paths_width() * EDSCALE; #else - const real_t line_width = 2; + const real_t line_width = get_tree()->get_debug_paths_width(); #endif - const Color color = Color(0.5, 0.6, 1.0, 0.7); - _cached_draw_pts.resize(curve->get_point_count() * 8); int count = 0; @@ -119,7 +117,7 @@ void Path2D::_notification(int p_what) { } } - draw_polyline(_cached_draw_pts, color, line_width, true); + draw_polyline(_cached_draw_pts, get_tree()->get_debug_paths_color(), line_width, true); } break; } } @@ -129,7 +127,7 @@ void Path2D::_curve_changed() { return; } - if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_navigation_hint()) { + if (!Engine::get_singleton()->is_editor_hint() && !get_tree()->is_debugging_paths_hint()) { return; } |