Fix minimum connection bounds

This commit is contained in:
GriffinR 2022-10-29 10:57:08 -04:00
parent 15e69dc9e7
commit fa859a691f
2 changed files with 7 additions and 0 deletions

View file

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

View file

@ -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();
}