Fix undo when working on tilemap layer in tilemap mode Pixels and tileset mode Manual.

Before this fix working the next context:
- Active layer is a tilemap layer.
- TilemapMode == Pixels.
- TilesetMode == Manual.
- At least a border of the tilemap cel bounds is made of noTiles and tiles with index ’X’ (or a border is made all of tile ‘X’).
- With the marquee tool select a rectangle which matchs or exceeds the bounds of tile ‘X’.
Then when you delete the selected pixels (with the ‘delete’ key), automatically Trim command was executed, and the trimmed border is lost in the undo information.

Now, we skip the trim command in the context:
- Active layer is a tilemap layer.
- TilemapMode == Pixels.
- TilesetMode == Manual.
This commit is contained in:
Gaspar Capello 2021-02-04 12:22:11 -03:00 committed by David Capello
parent c3d52f0bbe
commit e1402381a8

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2019-2020 Igara Studio S.A.
// Copyright (C) 2019-2021 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
@ -331,7 +331,10 @@ void Clipboard::clearMaskFromCels(Tx& tx,
// Get cel again just in case the cmd::ClearMask() called cmd::ClearCel()
cel = doc::get<Cel>(celId);
if (cel && cel->layer()->isTransparent()) {
if (cel && cel->layer()->isTransparent() &&
!(ColorBar::instance()->tilemapMode() == TilemapMode::Pixels &&
ColorBar::instance()->tilesetMode() == TilesetMode::Manual &&
cel->layer()->isTilemap())) {
tx(new cmd::TrimCel(cel));
}
}