From fa859a691f404fddb7f75621528d50ce7345b61c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Sat, 29 Oct 2022 10:57:08 -0400 Subject: [PATCH] Fix minimum connection bounds --- CHANGELOG.md | 1 + src/editor.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7992a51b..555fc370 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d - Fix Border Width/Height being set to 0 when creating a new map from an existing layout. - Fix certain UI elements not highlighting red on some platforms. - Fix Open Config Folder not responding +- Properly update the minimum offset for a connection when the map is changed. ## [4.5.0] - 2021-12-26 ### Added diff --git a/src/editor.cpp b/src/editor.cpp index 69a501b5..21873fd7 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -1753,6 +1753,12 @@ void Editor::setConnectionMap(QString mapName) { setConnectionEditControlsEnabled(true); selected_connection_item->connection->map_name = mapName; setCurrentConnectionDirection(selected_connection_item->connection->direction); + + // New map may have a different minimum offset than the last one. The maximum will be the same. + int min = selected_connection_item->getMinOffset(); + ui->spinBox_ConnectionOffset->setMinimum(min); + onConnectionOffsetChanged(qMax(min, selected_connection_item->connection->offset)); + updateMirroredConnectionMap(selected_connection_item->connection, originalMapName); maskNonVisibleConnectionTiles(); }