fix(editor): river/road path selection uses last brush pos, edge ramp note

- 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)
This commit is contained in:
Kelsi 2026-05-05 09:04:30 -07:00
parent f6d30fcf9b
commit 63f4711eb3
2 changed files with 9 additions and 4 deletions

View file

@ -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,

View file

@ -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];