From 84d969a42aadadf5e727cb1de34d547276f506bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 12 Jun 2019 22:35:35 +0200 Subject: [PATCH] Cleanup some unecessary editor/ includes in scene/ Part of #29730, handles false positives. --- scene/2d/camera_2d.cpp | 3 ++- scene/gui/control.cpp | 10 +++++----- scene/gui/gradient_edit.cpp | 11 +++++++++-- scene/gui/gradient_edit.h | 2 -- scene/gui/tree.cpp | 2 +- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index aa144915778..a0d74dd2834 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -29,10 +29,11 @@ /*************************************************************************/ #include "camera_2d.h" + +#include "core/engine.h" #include "core/math/math_funcs.h" #include "scene/scene_string_names.h" #include "servers/visual_server.h" -#include void Camera2D::_update_scroll() { diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 76275c2420e..9d7c08d3f3f 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -29,23 +29,23 @@ /*************************************************************************/ #include "control.h" -#include "core/project_settings.h" -#include "scene/main/canvas_layer.h" -#include "scene/main/viewport.h" -#include "servers/visual_server.h" #include "core/message_queue.h" #include "core/os/keyboard.h" #include "core/os/os.h" #include "core/print_string.h" +#include "core/project_settings.h" #include "scene/gui/label.h" #include "scene/gui/panel.h" +#include "scene/main/canvas_layer.h" +#include "scene/main/viewport.h" #include "scene/scene_string_names.h" +#include "servers/visual_server.h" + #ifdef TOOLS_ENABLED #include "editor/editor_settings.h" #include "editor/plugins/canvas_item_editor_plugin.h" #endif -#include Dictionary Control::_edit_get_state() const { diff --git a/scene/gui/gradient_edit.cpp b/scene/gui/gradient_edit.cpp index cfbc9d6d18a..75f5f798732 100644 --- a/scene/gui/gradient_edit.cpp +++ b/scene/gui/gradient_edit.cpp @@ -29,10 +29,17 @@ /*************************************************************************/ #include "gradient_edit.h" -#include "core/os/keyboard.h" -#include "editor/editor_scale.h" +#include "core/os/keyboard.h" + +#ifdef TOOLS_ENABLED +#include "editor/editor_scale.h" #define SPACING (3 * EDSCALE) +#define POINT_WIDTH (8 * EDSCALE) +#else +#define SPACING 3 +#define POINT_WIDTH 8 +#endif GradientEdit::GradientEdit() { grabbed = -1; diff --git a/scene/gui/gradient_edit.h b/scene/gui/gradient_edit.h index 662278a17bf..6f311077299 100644 --- a/scene/gui/gradient_edit.h +++ b/scene/gui/gradient_edit.h @@ -36,8 +36,6 @@ #include "scene/resources/default_theme/theme_data.h" #include "scene/resources/gradient.h" -#define POINT_WIDTH (8 * EDSCALE) - class GradientEdit : public Control { GDCLASS(GradientEdit, Control); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 451241af409..522c1ecb6ae 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -39,7 +39,7 @@ #include "scene/main/viewport.h" #ifdef TOOLS_ENABLED -#include "editor/editor_node.h" +#include "editor/editor_scale.h" #endif #include