Skip to content

Commit 5f6246b

Browse files
Fix map connection image exporting
1 parent 948aaeb commit 5f6246b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project somewhat adheres to [Semantic Versioning](https://semver.org/sp
2323
- Fix exported images on macOS using a different color space than in Porymap.
2424
- Fix some `INCBIN` statements not being parsed correctly.
2525
- Fix excessive logging if Porymap fails to monitor all map files.
26+
- Fix map connections getting cut off in exported map images if they're on the same side as another short map connection.
2627

2728
## [6.2.0] - 2025-08-08
2829
### Added

src/ui/mapimageexporter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,10 +614,10 @@ QMargins MapImageExporter::getMargins(const Map *map) {
614614
if (!targetMap) continue;
615615

616616
QRect rect = targetMap->getConnectionRect(dir);
617-
if (dir == "up") margins.setTop(rect.height());
618-
else if (dir == "down") margins.setBottom(rect.height());
619-
else if (dir == "left") margins.setLeft(rect.width());
620-
else if (dir == "right") margins.setRight(rect.width());
617+
if (dir == "up") margins.setTop(qMax(rect.height(), margins.top()));
618+
else if (dir == "down") margins.setBottom(qMax(rect.height(), margins.bottom()));
619+
else if (dir == "left") margins.setLeft(qMax(rect.width(), margins.left()));
620+
else if (dir == "right") margins.setRight(qMax(rect.width(), margins.right()));
621621
}
622622
}
623623
if (m_settings.showGrid) {

0 commit comments

Comments
 (0)