levels_on_top (above and below) should be part of the joined map history

This commit is contained in:
Laura Klünder 2017-11-14 23:37:12 +01:00
parent 8d7bc8c4b2
commit 57db0621ad
2 changed files with 7 additions and 2 deletions

View file

@ -197,8 +197,11 @@ class MapHistory:
maximum = np.maximum(self.data, other_data)
# add with mask
mask = self.add_new(mask_geometry.buffer(1), data=np.zeros_like(self.data, dtype=np.bool))
self.data[mask] = maximum[mask]
if mask_geometry is not None:
mask = self.add_new(mask_geometry.buffer(1), data=np.zeros_like(self.data, dtype=np.bool))
self.data[mask] = maximum[mask]
else:
self.data = maximum
# write new updates
self.updates = new_updates

View file

@ -231,6 +231,8 @@ class LevelRenderData:
if crop_to is not FakeCropper:
map_history.composite(MapHistory.open_level(sublevel.pk, 'base'), crop_to)
elif level.pk != sublevel.pk:
map_history.composite(MapHistory.open_level(sublevel.pk, 'base'), None)
new_geoms = LevelGeometries()
new_geoms.doors = crop_to.intersection(old_geoms.doors)