Fix incorrect diff between layers debugging the restoration of a backup (TEST_BACKUP_INTEGRITY)

Only in debug mode with TEST_BACKUP_INTEGRITY flag, we now don't
detect as a layer diff between the doc in memory and the restore doc
from backup if only some layer flags like visibility/collapse changed.
This commit is contained in:
David Capello 2024-05-20 22:04:21 -03:00
parent 3ea0437e1d
commit 2596d44732
2 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2019-2023 Igara Studio S.A.
// Copyright (C) 2019-2024 Igara Studio S.A.
// Copyright (C) 2018 David Capello
//
// This program is distributed under the terms of
@ -191,8 +191,8 @@ DocDiff compare_docs(const Doc* a,
if (aLay->type() != bLay->type() ||
aLay->name() != bLay->name() ||
aLay->userData() != bLay->userData() ||
((int(aLay->flags()) & int(LayerFlags::PersistentFlagsMask)) !=
(int(bLay->flags()) & int(LayerFlags::PersistentFlagsMask))) ||
((int(aLay->flags()) & int(LayerFlags::StructuralFlagsMask)) !=
(int(bLay->flags()) & int(LayerFlags::StructuralFlagsMask))) ||
(aLay->isImage() && bLay->isImage() &&
(((const LayerImage*)aLay)->opacity() != ((const LayerImage*)bLay)->opacity())) ||
(aLay->isTilemap() && bLay->isTilemap() &&

View File

@ -1,5 +1,5 @@
// Aseprite Document Library
// Copyright (C) 2019-2021 Igara Studio S.A.
// Copyright (C) 2019-2024 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This file is released under the terms of the MIT license.
@ -42,10 +42,13 @@ namespace doc {
Reference = 64, // Is a reference layer
PersistentFlagsMask = 0xffff,
Internal_WasVisible = 0x10000, // Was visible in the alternative state (Alt+click)
BackgroundLayerFlags = LockMove | Background,
// Flags that change the modified flag of the document
// (e.g. created by undoable actions).
StructuralFlagsMask = Background | Reference,
};
class Layer : public WithUserData {