Fix using MoveMask command without visible selection

Issue found testing #2796 without selection/without calling SelectTile
command.
This commit is contained in:
David Capello 2022-07-07 16:33:39 -03:00
parent daa7cc837a
commit 6e0394b7dc
2 changed files with 5 additions and 1 deletions

View File

@ -66,7 +66,10 @@ bool MoveMaskCommand::onEnabled(Context* context)
ContextFlags::HasActiveImage |
ContextFlags::ActiveLayerIsEditable);
else
return (current_editor ? true: false);
return (current_editor != nullptr) &&
context->checkFlags(ContextFlags::HasActiveDocument |
ContextFlags::HasVisibleMask |
ContextFlags::HasActiveImage);
}

View File

@ -2556,6 +2556,7 @@ void Editor::startSelectionTransformation(const gfx::Point& move, double angle)
movingPixels->rotate(angle);
}
else if (StandbyState* standby = dynamic_cast<StandbyState*>(m_state.get())) {
ASSERT(m_document->isMaskVisible());
standby->startSelectionTransformation(this, move, angle);
}
}