Skip to content

Commit a9e49a5

Browse files
committed
MapPart: Maintain visibility when merging all parts
When merging all parts, maintain visibility of the part into which the other are merged.
1 parent 1713c6e commit a9e49a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/gui/map/map_editor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3982,6 +3982,7 @@ void MapEditorController::mergeCurrentMapPartTo(int target)
39823982
void MapEditorController::mergeAllMapParts()
39833983
{
39843984
QString const name = map->getCurrentPart()->getName();
3985+
const auto visibility = map->getCurrentPart()->isVisible();
39853986
const QMessageBox::StandardButton button =
39863987
QMessageBox::question(
39873988
window,
@@ -3994,7 +3995,7 @@ void MapEditorController::mergeAllMapParts()
39943995
auto* undo = new CombinedUndoStep(map);
39953996

39963997
// For simplicity, we merge to the first part,
3997-
// but keep the properties (i.e. name) of the current part.
3998+
// but keep the properties (i.e. name, visibility) of the current part.
39983999
map->setCurrentPartIndex(0);
39994000
MapPart* target_part = map->getPart(0);
40004001

@@ -4011,6 +4012,7 @@ void MapEditorController::mergeAllMapParts()
40114012

40124013
undo->push(new MapPartUndoStep(map, MapPartUndoStep::ModifyMapPart, 0));
40134014
target_part->setName(name);
4015+
target_part->setVisible(visibility);
40144016

40154017
map->push(undo);
40164018
}

0 commit comments

Comments
 (0)