mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +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;
|
||||
}
|
||||
else if (m_range.enabled()) {
|
||||
Sprite* sprite = m_document->sprite();
|
||||
int count = 0;
|
||||
for (Cel* cel : m_document->sprite()->uniqueCels()) {
|
||||
if (m_range.inRange(cel->sprite()->layerToIndex(cel->layer()),
|
||||
cel->frame())) {
|
||||
for (Cel* cel : sprite->uniqueCels(m_range.frameBegin(),
|
||||
m_range.frameEnd())) {
|
||||
if (m_range.inRange(sprite->layerToIndex(cel->layer()))) {
|
||||
if (backgroundCount && cel->layer()->isBackground())
|
||||
++(*backgroundCount);
|
||||
++count;
|
||||
@ -183,11 +184,12 @@ private:
|
||||
App::instance()->getMainWindow()->getTimeline()->invalidate();
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (Cel* cel : m_document->sprite()->uniqueCels()) {
|
||||
if (m_range.inRange(cel->sprite()->layerToIndex(cel->layer()), cel->frame())) {
|
||||
if (!cel->layer()->isBackground() &&
|
||||
newOpacity != cel->opacity()) {
|
||||
else if (m_range.enabled()) {
|
||||
Sprite* sprite = m_document->sprite();
|
||||
for (Cel* cel : sprite->uniqueCels(m_range.frameBegin(),
|
||||
m_range.frameEnd())) {
|
||||
if (m_range.inRange(sprite->layerToIndex(cel->layer()))) {
|
||||
if (!cel->layer()->isBackground() && newOpacity != cel->opacity()) {
|
||||
transaction.execute(new cmd::SetCelOpacity(cel, newOpacity));
|
||||
}
|
||||
|
||||
|
@ -555,6 +555,11 @@ CelsRange Sprite::uniqueCels() const
|
||||
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)
|
||||
|
@ -1,5 +1,5 @@
|
||||
// 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.
|
||||
// Read LICENSE.txt for more information.
|
||||
@ -151,6 +151,7 @@ namespace doc {
|
||||
CelsRange cels() const;
|
||||
CelsRange cels(frame_t frame) const;
|
||||
CelsRange uniqueCels() const;
|
||||
CelsRange uniqueCels(frame_t from, frame_t to) const;
|
||||
|
||||
private:
|
||||
Document* m_document;
|
||||
|
Loading…
x
Reference in New Issue
Block a user