From 292c9e380aa5c78a0e8cc3341b5381db06d0c1e8 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Sun, 9 Feb 2020 23:08:18 -0300 Subject: [PATCH] Make Camera2D's editor helper code only be compiled on editor builds (cherry picked from commit f70ccbca52b6cec97c684e73d953b4ced4ba9fa1) --- scene/2d/camera_2d.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 43d9310a87b..ca16244ad64 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -269,6 +269,7 @@ void Camera2D::_notification(int p_what) { viewport = NULL; } break; +#ifdef TOOLS_ENABLED case NOTIFICATION_DRAW: { if (!is_inside_tree() || !Engine::get_singleton()->is_editor_hint()) @@ -345,8 +346,8 @@ void Camera2D::_notification(int p_what) { draw_line(inv_transform.xform(margin_endpoints[i]), inv_transform.xform(margin_endpoints[(i + 1) % 4]), margin_drawing_color, margin_drawing_width); } } - } break; +#endif } } @@ -644,7 +645,9 @@ Node *Camera2D::get_custom_viewport() const { void Camera2D::set_screen_drawing_enabled(bool enable) { screen_drawing_enabled = enable; +#ifdef TOOLS_ENABLED update(); +#endif } bool Camera2D::is_screen_drawing_enabled() const { @@ -653,7 +656,9 @@ bool Camera2D::is_screen_drawing_enabled() const { void Camera2D::set_limit_drawing_enabled(bool enable) { limit_drawing_enabled = enable; +#ifdef TOOLS_ENABLED update(); +#endif } bool Camera2D::is_limit_drawing_enabled() const { @@ -662,7 +667,9 @@ bool Camera2D::is_limit_drawing_enabled() const { void Camera2D::set_margin_drawing_enabled(bool enable) { margin_drawing_enabled = enable; +#ifdef TOOLS_ENABLED update(); +#endif } bool Camera2D::is_margin_drawing_enabled() const {