Enable reverse frames command only when we have two or more selected frames (fix #711)

This commit is contained in:
David Capello 2015-06-27 12:17:18 -03:00
parent e6ca8c9463
commit 34183ba207

View File

@ -38,7 +38,12 @@ ReverseFramesCommand::ReverseFramesCommand()
bool ReverseFramesCommand::onEnabled(Context* context)
{
return context->checkFlags(ContextFlags::ActiveDocumentIsWritable);
DocumentRange range = App::instance()->getMainWindow()->getTimeline()->range();
return
context->checkFlags(ContextFlags::ActiveDocumentIsWritable) &&
range.enabled() &&
range.frames() >= 2; // We need at least 2 frames to reverse
}
void ReverseFramesCommand::onExecute(Context* context)