mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-10 19:13:29 +00:00
Restore cleared area correctly when cel position is modified (fix #1109)
This commit is contained in:
parent
6556f97b8c
commit
53500c1990
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -54,6 +54,8 @@ ClearMask::ClearMask(Cel* cel)
|
||||
|
||||
m_dstImage.reset(new WithImage(image));
|
||||
m_bgcolor = doc->bgColor(cel->layer());
|
||||
m_boundsX = bounds.x;
|
||||
m_boundsY = bounds.y;
|
||||
|
||||
m_copy.reset(crop_image(image,
|
||||
bounds.x, bounds.y, bounds.w, bounds.h, m_bgcolor));
|
||||
@ -112,7 +114,7 @@ void ClearMask::clear()
|
||||
|
||||
void ClearMask::restore()
|
||||
{
|
||||
copy_image(m_dstImage->image(), m_copy.get(), m_offsetX, m_offsetY);
|
||||
copy_image(m_dstImage->image(), m_copy.get(), m_boundsX, m_boundsY);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -42,6 +42,7 @@ namespace cmd {
|
||||
base::UniquePtr<WithImage> m_dstImage;
|
||||
ImageRef m_copy;
|
||||
int m_offsetX, m_offsetY;
|
||||
int m_boundsX, m_boundsY;
|
||||
color_t m_bgcolor;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user