mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-31 16:20:22 +00:00
Fix tilemap layers empty after converting color profile (fix #3052)
Before this fix, tilemap layers disappeared after converting the Sprite's Color Profile in the Sprite Properties dialog.
This commit is contained in:
parent
04fb75a330
commit
b5a787a20f
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2018-2020 Igara Studio S.A.
|
||||
// Copyright (C) 2018-2021 Igara Studio S.A.
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -88,10 +88,12 @@ void convert_color_profile(doc::Sprite* sprite,
|
||||
if (sprite->pixelFormat() != doc::IMAGE_INDEXED) {
|
||||
for (Cel* cel : sprite->uniqueCels()) {
|
||||
ImageRef old_image = cel->imageRef();
|
||||
ImageRef new_image = convert_image_color_space(
|
||||
old_image.get(), newCS, conversion.get());
|
||||
if (old_image.get()->pixelFormat() != IMAGE_TILEMAP) {
|
||||
ImageRef new_image = convert_image_color_space(
|
||||
old_image.get(), newCS, conversion.get());
|
||||
|
||||
sprite->replaceImage(old_image->id(), new_image);
|
||||
sprite->replaceImage(old_image->id(), new_image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,10 +183,12 @@ ConvertColorProfile::ConvertColorProfile(doc::Sprite* sprite, const gfx::ColorSp
|
||||
if (sprite->pixelFormat() != doc::IMAGE_INDEXED) {
|
||||
for (Cel* cel : sprite->uniqueCels()) {
|
||||
ImageRef old_image = cel->imageRef();
|
||||
ImageRef new_image = convert_image_color_space(
|
||||
old_image.get(), newCS, conversion.get());
|
||||
if (old_image.get()->pixelFormat() != IMAGE_TILEMAP) {
|
||||
ImageRef new_image = convert_image_color_space(
|
||||
old_image.get(), newCS, conversion.get());
|
||||
|
||||
m_seq.add(new cmd::ReplaceImage(sprite, old_image, new_image));
|
||||
m_seq.add(new cmd::ReplaceImage(sprite, old_image, new_image));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user