From 31dcd3272a710a65333ced852bc83331ef98b564 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 24 May 2018 15:25:41 -0300 Subject: [PATCH] Fix error using filters when the selection is outside the canvas and is hidden/deselected (fix #1737) --- src/app/commands/filters/filter_manager_impl.cpp | 4 +++- src/app/commands/filters/filter_manager_impl.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/commands/filters/filter_manager_impl.cpp b/src/app/commands/filters/filter_manager_impl.cpp index 2f4673683..c38793fe4 100644 --- a/src/app/commands/filters/filter_manager_impl.cpp +++ b/src/app/commands/filters/filter_manager_impl.cpp @@ -427,7 +427,9 @@ doc::PalettePicks FilterManagerImpl::getPalettePicks() void FilterManagerImpl::init(Cel* cel) { ASSERT(cel); - if (!updateBounds(static_cast(m_site.document())->mask())) + + Document* doc = static_cast(m_site.document()); + if (!updateBounds(doc->isMaskVisible() ? doc->mask(): nullptr)) throw InvalidAreaException(); m_cel = cel; diff --git a/src/app/commands/filters/filter_manager_impl.h b/src/app/commands/filters/filter_manager_impl.h index b997482ec..135b78bc1 100644 --- a/src/app/commands/filters/filter_manager_impl.h +++ b/src/app/commands/filters/filter_manager_impl.h @@ -44,7 +44,7 @@ namespace app { class InvalidAreaException : public base::Exception { public: InvalidAreaException() throw() - : base::Exception("The current mask/area to apply the effect is completely invalid.") { } + : base::Exception("The active selection to apply the effect is out of the canvas.") { } }; class NoImageException : public base::Exception {