Skip to content

Commit

Permalink
[#190]: Fix minor issues with Gizmo
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDomagala committed Feb 5, 2024
1 parent 134a779 commit 6ca2d86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions editor/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,8 @@ Editor::HandleGameObjectClicked(Object::ID newSelectedGameObject, bool groupSele
UnselectAll();
SelectGameObject(newSelectedGameObject);
}
else
{
selectedObjects_.push_back(newSelectedGameObject);
}

selectedObjects_.push_back(newSelectedGameObject);
}

movementOnGameObject_ = !fromGUI;
Expand Down Expand Up @@ -635,6 +633,7 @@ Editor::UnselectGameObject(Object::ID object, bool groupSelect)
if (currentSelectedGameObject_ == object)
{
currentSelectedGameObject_ = Object::INVALID_ID;
selectedObjects_.clear();
}
else if (groupSelect)
{
Expand All @@ -645,7 +644,6 @@ Editor::UnselectGameObject(Object::ID object, bool groupSelect)
}
}


if (selectedObjects_.empty())
{
gizmo_.Hide();
Expand Down Expand Up @@ -903,6 +901,9 @@ Editor::Render(VkCommandBuffer cmdBuffer)

currentLevel_->RenderGameObjects();

gizmo_.Render();


vkCmdBindPipeline(cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, renderData.pipeline);

auto offsets = std::to_array< const VkDeviceSize >({0});
Expand Down
2 changes: 1 addition & 1 deletion editor/gui/editor_gui_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ EditorGUI::RenderSelectedObjectsMenu()
{
const auto& gameObject = currentLevel_->GetGameObjectRef(object);
parent_.GetCamera().SetCameraAtPosition(gameObject.GetPosition());
parent_.HandleGameObjectClicked(object, true, true);
parent_.HandleGameObjectClicked(object, false, true);

// Don't make the UI jump
setScrollTo_ = {};
Expand Down

0 comments on commit 6ca2d86

Please sign in to comment.