Merge pull request #595 from marynate/PR-fix-view-grid
Fixed #470 View grid toggle in 3d not working
This commit is contained in:
commit
2693a883fa
1 changed files with 8 additions and 2 deletions
|
@ -2345,8 +2345,7 @@ void SpatialEditor::set_state(const Dictionary& p_state) {
|
||||||
bool use = d["show_grid"];
|
bool use = d["show_grid"];
|
||||||
|
|
||||||
if (use!=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_GRID))) {
|
if (use!=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_GRID))) {
|
||||||
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_GRID), use );
|
_menu_item_pressed(MENU_VIEW_GRID);
|
||||||
grid_enabled=use;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2653,6 +2652,13 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
|
||||||
|
|
||||||
grid_enabled=!is_checked;
|
grid_enabled=!is_checked;
|
||||||
|
|
||||||
|
for(int i=0;i<3;++i) {
|
||||||
|
if (grid_enable[i]) {
|
||||||
|
VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,grid_enabled);
|
||||||
|
grid_visible[i]=grid_enabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(p_option), grid_enabled );
|
view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(p_option), grid_enabled );
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue