mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-07 06:40:10 +00:00
Fix setting opacity or user data of linked cels when the first cel isn't included in the active range
This commit is contained in:
parent
99d504a3aa
commit
be57d0332f
@ -106,10 +106,11 @@ private:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else if (m_range.enabled()) {
|
else if (m_range.enabled()) {
|
||||||
|
Sprite* sprite = m_document->sprite();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (Cel* cel : m_document->sprite()->uniqueCels()) {
|
for (Cel* cel : sprite->uniqueCels(m_range.frameBegin(),
|
||||||
if (m_range.inRange(cel->sprite()->layerToIndex(cel->layer()),
|
m_range.frameEnd())) {
|
||||||
cel->frame())) {
|
if (m_range.inRange(sprite->layerToIndex(cel->layer()))) {
|
||||||
if (backgroundCount && cel->layer()->isBackground())
|
if (backgroundCount && cel->layer()->isBackground())
|
||||||
++(*backgroundCount);
|
++(*backgroundCount);
|
||||||
++count;
|
++count;
|
||||||
@ -183,11 +184,12 @@ private:
|
|||||||
App::instance()->getMainWindow()->getTimeline()->invalidate();
|
App::instance()->getMainWindow()->getTimeline()->invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else if (m_range.enabled()) {
|
||||||
for (Cel* cel : m_document->sprite()->uniqueCels()) {
|
Sprite* sprite = m_document->sprite();
|
||||||
if (m_range.inRange(cel->sprite()->layerToIndex(cel->layer()), cel->frame())) {
|
for (Cel* cel : sprite->uniqueCels(m_range.frameBegin(),
|
||||||
if (!cel->layer()->isBackground() &&
|
m_range.frameEnd())) {
|
||||||
newOpacity != cel->opacity()) {
|
if (m_range.inRange(sprite->layerToIndex(cel->layer()))) {
|
||||||
|
if (!cel->layer()->isBackground() && newOpacity != cel->opacity()) {
|
||||||
transaction.execute(new cmd::SetCelOpacity(cel, newOpacity));
|
transaction.execute(new cmd::SetCelOpacity(cel, newOpacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -555,6 +555,11 @@ CelsRange Sprite::uniqueCels() const
|
|||||||
return CelsRange(this, frame_t(0), lastFrame(), CelsRange::UNIQUE);
|
return CelsRange(this, frame_t(0), lastFrame(), CelsRange::UNIQUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CelsRange Sprite::uniqueCels(frame_t from, frame_t to) const
|
||||||
|
{
|
||||||
|
return CelsRange(this, from, to, CelsRange::UNIQUE);
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static Layer* index2layer(const Layer* layer, const LayerIndex& index, int* index_count)
|
static Layer* index2layer(const Layer* layer, const LayerIndex& index, int* index_count)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite Document Library
|
// Aseprite Document Library
|
||||||
// Copyright (c) 2001-2015 David Capello
|
// Copyright (c) 2001-2016 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
// Read LICENSE.txt for more information.
|
// Read LICENSE.txt for more information.
|
||||||
@ -151,6 +151,7 @@ namespace doc {
|
|||||||
CelsRange cels() const;
|
CelsRange cels() const;
|
||||||
CelsRange cels(frame_t frame) const;
|
CelsRange cels(frame_t frame) const;
|
||||||
CelsRange uniqueCels() const;
|
CelsRange uniqueCels() const;
|
||||||
|
CelsRange uniqueCels(frame_t from, frame_t to) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Document* m_document;
|
Document* m_document;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user