Fix Flip command when ENABLE_UI is off

This commit is contained in:
David Capello 2020-05-27 14:48:16 -03:00
parent c49c6ae068
commit 1b08d5248c

View File

@ -75,6 +75,7 @@ void FlipCommand::onExecute(Context* ctx)
CelList cels;
if (m_flipMask) {
#ifdef ENABLE_UI
// If we want to flip the visible mask we can go to
// MovingPixelsState (even when the range is enabled, because now
// PixelsMovement support ranges).
@ -88,6 +89,7 @@ void FlipCommand::onExecute(Context* ctx)
return;
}
}
#endif
auto range = site.range();
if (range.enabled()) {
@ -100,8 +102,12 @@ void FlipCommand::onExecute(Context* ctx)
}
if (cels.empty()) {
StatusBar::instance()->showTip(
1000, Strings::statusbar_tips_all_layers_are_locked());
#ifdef ENABLE_UI
if (ctx->isUIAvailable()) {
StatusBar::instance()->showTip(
1000, Strings::statusbar_tips_all_layers_are_locked());
}
#endif // ENABLE_UI
return;
}
}