diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/debugger/editor_visual_profiler.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 34 |
3 files changed, 22 insertions, 22 deletions
diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 554a9dc6a5..e523a9157c 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -67,7 +67,7 @@ void EditorVisualProfiler::add_frame_metric(const Metric &p_metric) { updating_frame = true; cursor_metric_edit->set_max(frame_metrics[last_metric].frame_number); - cursor_metric_edit->set_min(MAX(frame_metrics[last_metric].frame_number - frame_metrics.size(), 0)); + cursor_metric_edit->set_min(MAX(frame_metrics[last_metric].frame_number - frame_metrics.size(), 0u)); if (!seeking) { cursor_metric_edit->set_value(frame_metrics[last_metric].frame_number); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 75f97efdbc..4ea30be373 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -60,12 +60,12 @@ // Min and Max are power of two in order to play nicely with successive increment. // That way, we can naturally reach a 100% zoom from boundaries. -#define MIN_ZOOM 1. / 128 -#define MAX_ZOOM 128 +constexpr real_t MIN_ZOOM = 1. / 128; +constexpr real_t MAX_ZOOM = 128; #define RULER_WIDTH (15 * EDSCALE) -#define SCALE_HANDLE_DISTANCE 25 -#define MOVE_HANDLE_DISTANCE 25 +constexpr real_t SCALE_HANDLE_DISTANCE = 25; +constexpr real_t MOVE_HANDLE_DISTANCE = 25; class SnapDialog : public ConfirmationDialog { GDCLASS(SnapDialog, ConfirmationDialog); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 3927aaa438..d06553b3f6 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -56,31 +56,31 @@ #include "scene/resources/packed_scene.h" #include "scene/resources/surface_tool.h" -#define DISTANCE_DEFAULT 4 +constexpr real_t DISTANCE_DEFAULT = 4; -#define GIZMO_ARROW_SIZE 0.35 -#define GIZMO_RING_HALF_WIDTH 0.1 -#define GIZMO_PLANE_SIZE 0.2 -#define GIZMO_PLANE_DST 0.3 -#define GIZMO_CIRCLE_SIZE 1.1 -#define GIZMO_SCALE_OFFSET (GIZMO_CIRCLE_SIZE + 0.3) -#define GIZMO_ARROW_OFFSET (GIZMO_CIRCLE_SIZE + 0.3) +constexpr real_t GIZMO_ARROW_SIZE = 0.35; +constexpr real_t GIZMO_RING_HALF_WIDTH = 0.1; +constexpr real_t GIZMO_PLANE_SIZE = 0.2; +constexpr real_t GIZMO_PLANE_DST = 0.3; +constexpr real_t GIZMO_CIRCLE_SIZE = 1.1; +constexpr real_t GIZMO_SCALE_OFFSET = GIZMO_CIRCLE_SIZE + 0.3; +constexpr real_t GIZMO_ARROW_OFFSET = GIZMO_CIRCLE_SIZE + 0.3; -#define ZOOM_FREELOOK_MIN 0.01 -#define ZOOM_FREELOOK_MULTIPLIER 1.08 -#define ZOOM_FREELOOK_INDICATOR_DELAY_S 1.5 +constexpr real_t ZOOM_FREELOOK_MIN = 0.01; +constexpr real_t ZOOM_FREELOOK_MULTIPLIER = 1.08; +constexpr real_t ZOOM_FREELOOK_INDICATOR_DELAY_S = 1.5; #ifdef REAL_T_IS_DOUBLE -#define ZOOM_FREELOOK_MAX 1'000'000'000'000 +constexpr double ZOOM_FREELOOK_MAX = 1'000'000'000'000; #else -#define ZOOM_FREELOOK_MAX 10'000 +constexpr float ZOOM_FREELOOK_MAX = 10'000; #endif -#define MIN_Z 0.01 -#define MAX_Z 1000000.0 +constexpr real_t MIN_Z = 0.01; +constexpr real_t MAX_Z = 1000000.0; -#define MIN_FOV 0.01 -#define MAX_FOV 179 +constexpr real_t MIN_FOV = 0.01; +constexpr real_t MAX_FOV = 179; void ViewportRotationControl::_notification(int p_what) { switch (p_what) { |