Fix issue #548 - Avoid moving hidden layers or auto-selecting them

This commit is contained in:
David Capello 2014-11-30 09:43:33 -03:00
parent 4a1ee6d557
commit aee7eb7bd4
2 changed files with 5 additions and 1 deletions

View File

@ -208,6 +208,10 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
StatusBar::instance()->showTip(1000,
"The background layer cannot be moved");
}
else if (!layer->isReadable()) {
StatusBar::instance()->showTip(1000,
"Layer '%s' is hidden", layer->name().c_str());
}
else if (!layer->isMoveable() || !layer->isWritable()) {
StatusBar::instance()->showTip(1000,
"Layer '%s' is locked", layer->name().c_str());

View File

@ -498,7 +498,7 @@ void Sprite::pickCels(int x, int y, FrameNumber frame, int opacityThreshold, Cel
for (int i=(int)layers.size()-1; i>=0; --i) {
Layer* layer = layers[i];
if (!layer->isImage())
if (!layer->isImage() || !layer->isReadable())
continue;
Cel* cel = static_cast<LayerImage*>(layer)->getCel(frame);