diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e076930..42ecac29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project somewhat adheres to [Semantic Versioning](https://semver.org/sp - Fix exported images on macOS using a different color space than in Porymap. - Fix some `INCBIN` statements not being parsed correctly. - Fix excessive logging if Porymap fails to monitor all map files. +- Fix map connections getting cut off in exported map images if they're on the same side as another short map connection. ## [6.2.0] - 2025-08-08 ### Added diff --git a/src/ui/mapimageexporter.cpp b/src/ui/mapimageexporter.cpp index 91a6fb5a..e23f81e1 100644 --- a/src/ui/mapimageexporter.cpp +++ b/src/ui/mapimageexporter.cpp @@ -614,10 +614,10 @@ QMargins MapImageExporter::getMargins(const Map *map) { if (!targetMap) continue; QRect rect = targetMap->getConnectionRect(dir); - if (dir == "up") margins.setTop(rect.height()); - else if (dir == "down") margins.setBottom(rect.height()); - else if (dir == "left") margins.setLeft(rect.width()); - else if (dir == "right") margins.setRight(rect.width()); + if (dir == "up") margins.setTop(qMax(rect.height(), margins.top())); + else if (dir == "down") margins.setBottom(qMax(rect.height(), margins.bottom())); + else if (dir == "left") margins.setLeft(qMax(rect.width(), margins.left())); + else if (dir == "right") margins.setRight(qMax(rect.width(), margins.right())); } } if (m_settings.showGrid) {