From 63f4711eb32bb76e428a6f1333b6c2515c5781d2 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 5 May 2026 09:04:30 -0700 Subject: [PATCH] fix(editor): river/road path selection uses last brush pos, edge ramp note MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Set Start/End buttons for river/road no longer require brush to be actively on terrain at click time — uses last known brush position which persists when cursor moves to the UI panel - Shows cursor coordinates above the buttons for visual confirmation - Edge ramp confirmed to only affect terrain heights, not water levels (water has its own height independent of terrain) --- tools/editor/editor_ui.cpp | 12 ++++++++---- tools/editor/terrain_editor.cpp | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/editor/editor_ui.cpp b/tools/editor/editor_ui.cpp index 8166d6e3..3155b9b4 100644 --- a/tools/editor/editor_ui.cpp +++ b/tools/editor/editor_ui.cpp @@ -622,14 +622,18 @@ void EditorUI::renderBrushPanel(EditorApp& app) { ImGui::SliderFloat("Width##path", &pathWidth, 2.0f, 50.0f); if (pathMode == 0) ImGui::SliderFloat("Depth##path", &pathDepth, 1.0f, 30.0f); auto& brush4 = app.getTerrainEditor().brush(); - if (ImGui::Button("Set Start##path", ImVec2(120, 0)) && brush4.isActive()) { - pathStart = brush4.getPosition(); + auto brushPos = brush4.getPosition(); + ImGui::Text("Cursor: %.0f, %.0f, %.0f %s", + brushPos.x, brushPos.y, brushPos.z, + brush4.isActive() ? "" : "(off terrain)"); + if (ImGui::Button("Set Start##path", ImVec2(120, 0))) { + pathStart = brushPos; pathStartSet = true; app.showToast("Path start set"); } ImGui::SameLine(); - if (ImGui::Button("Set End + Apply##path", ImVec2(140, 0)) && brush4.isActive() && pathStartSet) { - pathEnd = brush4.getPosition(); + if (ImGui::Button("Set End + Apply##path", ImVec2(140, 0)) && pathStartSet) { + pathEnd = brushPos; if (pathMode == 0) { app.getTerrainEditor().carveRiver(pathStart, pathEnd, pathWidth, pathDepth); app.getTexturePainter().paintAlongPath(pathStart, pathEnd, pathWidth * 1.5f, diff --git a/tools/editor/terrain_editor.cpp b/tools/editor/terrain_editor.cpp index 3a692440..0f488cab 100644 --- a/tools/editor/terrain_editor.cpp +++ b/tools/editor/terrain_editor.cpp @@ -1086,6 +1086,7 @@ void TerrainEditor::addDetailNoise(float amplitude, float frequency, uint32_t se void TerrainEditor::rampEdges(float targetHeight, float rampWidth) { if (!terrain_) return; float relTarget = targetHeight - terrain_->chunks[0].position[2]; + // Note: only affects terrain heights, not water levels for (int ci = 0; ci < 256; ci++) { auto& chunk = terrain_->chunks[ci];