From bdfadc7e765ff65ea483433e4ebf9bef0b500018 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 5 May 2026 09:14:31 -0700 Subject: [PATCH] fix(editor): remove all remaining brush.isActive() checks from UI buttons - Pick height, Punch Hole, Fill Hole, Delete All in Radius buttons no longer require cursor to be actively on terrain - All buttons now use last known brush position consistently - Fixes the fundamental UX issue where clicking a UI button moves the cursor off terrain, making the button do nothing --- tools/editor/editor_ui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/editor/editor_ui.cpp b/tools/editor/editor_ui.cpp index c5aae845..ed2f93c7 100644 --- a/tools/editor/editor_ui.cpp +++ b/tools/editor/editor_ui.cpp @@ -517,7 +517,7 @@ void EditorUI::renderBrushPanel(EditorApp& app) { ImGui::SliderFloat("Target Height", &s.flattenHeight, -500.0f, 1000.0f, "%.1f"); ImGui::SameLine(); auto& brush = app.getTerrainEditor().brush(); - if (ImGui::SmallButton("Pick") && brush.isActive()) + if (ImGui::SmallButton("Pick") ) s.flattenHeight = brush.getPosition().z; if (ImGui::IsItemHovered()) ImGui::SetTooltip("Set target height from cursor position"); @@ -864,10 +864,10 @@ void EditorUI::renderBrushPanel(EditorApp& app) { ImGui::Separator(); ImGui::Text("Terrain Holes (cave entrances):"); auto& brush = app.getTerrainEditor().brush(); - if (ImGui::Button("Punch Hole", ImVec2(120, 0)) && brush.isActive()) + if (ImGui::Button("Punch Hole", ImVec2(120, 0)) ) app.getTerrainEditor().punchHole(brush.getPosition(), s.radius); ImGui::SameLine(); - if (ImGui::Button("Fill Hole", ImVec2(120, 0)) && brush.isActive()) + if (ImGui::Button("Fill Hole", ImVec2(120, 0)) ) app.getTerrainEditor().fillHole(brush.getPosition(), s.radius); ImGui::Separator(); @@ -1264,7 +1264,7 @@ void EditorUI::renderObjectPanel(EditorApp& app) { static float bulkRadius = 50.0f; ImGui::SliderFloat("Radius##bulk", &bulkRadius, 10.0f, 200.0f); auto& brush = app.getTerrainEditor().brush(); - if (ImGui::Button("Delete All in Radius", ImVec2(-1, 0)) && brush.isActive()) { + if (ImGui::Button("Delete All in Radius", ImVec2(-1, 0)) ) { auto& objs = const_cast&>(placer.getObjects()); glm::vec3 center = brush.getPosition(); objs.erase(std::remove_if(objs.begin(), objs.end(),