mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-30 22:21:12 +00:00
Fix movement of several layer with locked layers, results in a missed image.
Before this fix, the selected image in the active layer was missed. The sequence to reproduce this bug: - The user moves the selected image portion with several selected layers to a new position, - Then it locks the active layer, - Finally, it drops the selection (click outside the selected area). The selected image in the active layer is missed.
This commit is contained in:
parent
f9a9e1a0bc
commit
064482b352
@ -585,6 +585,14 @@ void PixelsMovement::stampImage(bool finalStamp)
|
|||||||
cels.push_back(currentCel);
|
cels.push_back(currentCel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentCel && currentCel->layer() &&
|
||||||
|
currentCel->layer()->isImage() &&
|
||||||
|
!currentCel->layer()->isEditableHierarchy()) {
|
||||||
|
Transformation initialCelPos(gfx::Rect(m_initialMask0->bounds()));
|
||||||
|
redrawExtraImage(&initialCelPos);
|
||||||
|
stampExtraCelImage();
|
||||||
|
}
|
||||||
|
|
||||||
for (Cel* target : cels) {
|
for (Cel* target : cels) {
|
||||||
// We'll re-create the transformation for the other cels
|
// We'll re-create the transformation for the other cels
|
||||||
if (target != currentCel) {
|
if (target != currentCel) {
|
||||||
@ -992,14 +1000,15 @@ CelList PixelsMovement::getEditableCels()
|
|||||||
// TODO This case is used in paste too, where the cel() can be
|
// TODO This case is used in paste too, where the cel() can be
|
||||||
// nullptr (e.g. we paste the clipboard image into an empty
|
// nullptr (e.g. we paste the clipboard image into an empty
|
||||||
// cel).
|
// cel).
|
||||||
cels.push_back(m_site.cel());
|
if (m_site.layer() && m_site.layer()->isEditableHierarchy())
|
||||||
|
cels.push_back(m_site.cel());
|
||||||
return cels;
|
return cels;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Current cel (m_site.cel()) can be nullptr when we paste in an
|
// Current cel (m_site.cel()) can be nullptr when we paste in an
|
||||||
// empty cel (Ctrl+V) and cut (Ctrl+X) the floating pixels.
|
// empty cel (Ctrl+V) and cut (Ctrl+X) the floating pixels.
|
||||||
if (m_site.cel() &&
|
if (m_site.cel() &&
|
||||||
m_site.cel()->layer()->isEditable()) {
|
m_site.cel()->layer()->isEditableHierarchy()) {
|
||||||
auto it = std::find(cels.begin(), cels.end(), m_site.cel());
|
auto it = std::find(cels.begin(), cels.end(), m_site.cel());
|
||||||
if (it != cels.end())
|
if (it != cels.end())
|
||||||
cels.erase(it);
|
cels.erase(it);
|
||||||
|
@ -39,7 +39,7 @@ static CelList get_cels_templ(const Sprite* sprite,
|
|||||||
for (Layer* layer : range.selectedLayers()) {
|
for (Layer* layer : range.selectedLayers()) {
|
||||||
if (!layer ||
|
if (!layer ||
|
||||||
!layer->isImage() ||
|
!layer->isImage() ||
|
||||||
(onlyUnlockedCel && !layer->isEditable()))
|
(onlyUnlockedCel && !layer->isEditableHierarchy()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
LayerImage* layerImage = static_cast<LayerImage*>(layer);
|
LayerImage* layerImage = static_cast<LayerImage*>(layer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user