From 85ce7eea6e756bc80a3020aa30305502c3f8cb1f Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 8 May 2019 19:18:19 -0300 Subject: [PATCH] Fix compilation error when ENABLE_UI is undefined --- src/app/ui/editor/tool_loop_impl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/ui/editor/tool_loop_impl.cpp b/src/app/ui/editor/tool_loop_impl.cpp index 0368b84cc..046c81221 100644 --- a/src/app/ui/editor/tool_loop_impl.cpp +++ b/src/app/ui/editor/tool_loop_impl.cpp @@ -581,7 +581,8 @@ public: bool isCanceled() override { return m_canceled; } void onSliceRect(const gfx::Rect& bounds) override { - if (getMouseButton() == ToolLoop::Left) { +#ifdef ENABLE_UI // TODO add support for slice tool from batch scripts without UI? + if (m_editor && getMouseButton() == ToolLoop::Left) { // Try to select slices, but if it returns false, it means that // there are no slices in the box to be selected, so we show a // popup menu to create a new one. @@ -602,6 +603,7 @@ public: return; } } +#endif // Cancel the operation (do not create a new transaction for this // no-op, e.g. just change the set of selected slices).