Fix Clear command to delete the selection first when the range is enabled in one frame/one layer

This commit is contained in:
David Capello 2014-04-29 01:19:39 -03:00
parent 0120ef58e1
commit d470a6b78a

View File

@ -66,7 +66,7 @@ void ClearCommand::onExecute(Context* context)
{ {
// Clear of several frames is handled with RemoveCel command. // Clear of several frames is handled with RemoveCel command.
Timeline::Range range = App::instance()->getMainWindow()->getTimeline()->range(); Timeline::Range range = App::instance()->getMainWindow()->getTimeline()->range();
if (range.enabled()) { if (range.enabled() && (range.layers() > 1 || range.frames() > 1)) {
Command* subCommand = CommandsModule::instance() Command* subCommand = CommandsModule::instance()
->getCommandByName(CommandId::RemoveCel); ->getCommandByName(CommandId::RemoveCel);
context->executeCommand(subCommand); context->executeCommand(subCommand);