summaryrefslogtreecommitdiff
path: root/editor/plugins/spatial_editor_plugin.cpp
diff options
context:
space:
mode:
authorIbrahn Sahir <ibrahn.sahir@gmail.com>2018-09-20 12:27:32 +0100
committerIbrahn Sahir <ibrahn.sahir@gmail.com>2018-09-20 13:06:13 +0100
commitce15cf8ebc976c63cd19e0024102f67677c8c1ff (patch)
tree91fff4ccca0d89d42c39eb5b89ccfbc2452d532a /editor/plugins/spatial_editor_plugin.cpp
parenta4f5daca67760daf40e0867c8b530ab085f62a71 (diff)
fix branch on uninit in spatial_editor_plugin
Moved the initialisation of origin_enabled up a bit, to be inited before it's accessed in _init_grid. A step towards cleaner valgrind output and removes an opportunity for a random occurance of the origin/grid z-fighting issue. Also removed unused variable last_grid_snap to avoid later confusion.
Diffstat (limited to 'editor/plugins/spatial_editor_plugin.cpp')
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index 6df026843a..fed4362405 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -4418,6 +4418,8 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
void SpatialEditor::_init_indicators() {
{
+ origin_enabled = true;
+ grid_enabled = true;
indicator_mat.instance();
indicator_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
@@ -4458,10 +4460,6 @@ void SpatialEditor::_init_indicators() {
VS::get_singleton()->instance_set_layer_mask(origin_instance, 1 << SpatialEditorViewport::GIZMO_GRID_LAYER);
VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(origin_instance, VS::SHADOW_CASTING_SETTING_OFF);
-
- origin_enabled = true;
- grid_enabled = true;
- last_grid_snap = 1;
}
{