summaryrefslogtreecommitdiff
path: root/editor/editor_properties.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r--editor/editor_properties.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index e14beabfa2..c134786b89 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,8 +31,10 @@
#include "editor_properties.h"
#include "editor/editor_resource_preview.h"
+#include "editor/filesystem_dock.h"
#include "editor_node.h"
#include "editor_properties_array_dict.h"
+#include "editor_scale.h"
#include "scene/main/viewport.h"
///////////////////// NULL /////////////////////////
@@ -803,10 +805,10 @@ EditorPropertyLayers::EditorPropertyLayers() {
///////////////////// INT /////////////////////////
-void EditorPropertyInteger::_value_changed(double val) {
+void EditorPropertyInteger::_value_changed(int64_t val) {
if (setting)
return;
- emit_changed(get_edited_property(), (int64_t)val);
+ emit_changed(get_edited_property(), val);
}
void EditorPropertyInteger::update_property() {
@@ -814,14 +816,19 @@ void EditorPropertyInteger::update_property() {
setting = true;
spin->set_value(val);
setting = false;
+#ifdef DEBUG_ENABLED
+ // If spin (currently EditorSplinSlider : Range) is changed so that it can use int64_t, then the below warning wouldn't be a problem.
+ if (val != (int64_t)(double)(val)) {
+ WARN_PRINT("Cannot reliably represent '" + itos(val) + "' in the inspector, value is too large.");
+ }
+#endif
}
void EditorPropertyInteger::_bind_methods() {
-
ClassDB::bind_method(D_METHOD("_value_changed"), &EditorPropertyInteger::_value_changed);
}
-void EditorPropertyInteger::setup(int p_min, int p_max, int p_step, bool p_allow_greater, bool p_allow_lesser) {
+void EditorPropertyInteger::setup(int64_t p_min, int64_t p_max, int64_t p_step, bool p_allow_greater, bool p_allow_lesser) {
spin->set_min(p_min);
spin->set_max(p_max);
spin->set_step(p_step);
@@ -979,8 +986,6 @@ void EditorPropertyEasing::_draw_easing() {
RID ci = easing_draw->get_canvas_item();
Size2 s = easing_draw->get_size();
- Rect2 r(Point2(), s);
- r = r.grow(3);
const int points = 48;