summaryrefslogtreecommitdiff
path: root/scene/2d/node_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/node_2d.cpp')
-rw-r--r--scene/2d/node_2d.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp
index 336c8aa78e..7deebe9b27 100644
--- a/scene/2d/node_2d.cpp
+++ b/scene/2d/node_2d.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 */
@@ -35,6 +35,7 @@
#include "scene/main/viewport.h"
#include "servers/visual_server.h"
+#ifdef TOOLS_ENABLED
Dictionary Node2D::_edit_get_state() const {
Dictionary state;
@@ -44,6 +45,7 @@ Dictionary Node2D::_edit_get_state() const {
return state;
}
+
void Node2D::_edit_set_state(const Dictionary &p_state) {
pos = p_state["position"];
@@ -119,6 +121,7 @@ void Node2D::_edit_set_rect(const Rect2 &p_edit_rect) {
_change_notify("scale");
_change_notify("position");
}
+#endif
void Node2D::_update_xform_values() {
@@ -170,6 +173,7 @@ void Node2D::set_scale(const Size2 &p_scale) {
if (_xform_dirty)
((Node2D *)this)->_update_xform_values();
_scale = p_scale;
+ // Avoid having 0 scale values, can lead to errors in physics and rendering.
if (_scale.x == 0)
_scale.x = CMP_EPSILON;
if (_scale.y == 0)