Use right click action with shading ink (fix #4520) (#4615)

This commit is contained in:
دانتي باولا 2024-08-29 10:45:52 -03:00 committed by GitHub
parent e87f6df72b
commit dd208ebe5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,7 @@
#include "app/tools/active_tool.h" #include "app/tools/active_tool.h"
#include "app/app.h"
#include "app/color.h" #include "app/color.h"
#include "app/pref/preferences.h" #include "app/pref/preferences.h"
#include "app/tools/active_tool_observer.h" #include "app/tools/active_tool_observer.h"
@ -18,6 +19,7 @@
#include "app/tools/pointer.h" #include "app/tools/pointer.h"
#include "app/tools/tool_box.h" #include "app/tools/tool_box.h"
#include "app/ui/color_bar.h" #include "app/ui/color_bar.h"
#include "app/ui/context_bar.h"
namespace app { namespace app {
namespace tools { namespace tools {
@ -236,7 +238,14 @@ void ActiveToolManager::setSelectedTool(Tool* tool)
// static // static
bool ActiveToolManager::isToolAffectedByRightClickMode(Tool* tool) bool ActiveToolManager::isToolAffectedByRightClickMode(Tool* tool)
{ {
#if ENABLE_UI
bool shadingMode = ((Preferences::instance().tool(tool).ink() == InkType::SHADING) &&
(App::instance()->contextBar()->getShade().size() >= 2));
#else
bool shadingMode = (Preferences::instance().tool(tool).ink() == InkType::SHADING); bool shadingMode = (Preferences::instance().tool(tool).ink() == InkType::SHADING);
#endif
return return
((tool->getInk(0)->isPaint() && !shadingMode) || ((tool->getInk(0)->isPaint() && !shadingMode) ||
(tool->getInk(0)->isEffect())) && (tool->getInk(0)->isEffect())) &&