Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Upgraded-KisToolGradient-Init-Capture-Lambda

Ricky Ringler74b40eb94f2b
diff --git a/plugins/tools/basictools/kis_tool_gradient.cc b/plugins/tools/basictools/kis_tool_gradient.cc
index ca705e5906..0bd25f63b0 100644
--- a/plugins/tools/basictools/kis_tool_gradient.cc
+++ b/plugins/tools/basictools/kis_tool_gradient.cc
@@ -154,15 +154,6 @@ void KisToolGradient::endPrimaryAction(KoPointerEvent *event)
new KisResourcesSnapshot(image, currentNode(), this->canvas()->resourceManager());
if (image && resources->currentNode()->paintDevice()) {
- // TODO: refactor out local variables when we switch to C++14
- QPointF startPos = m_startPos;
- QPointF endPos = m_endPos;
- KisGradientPainter::enumGradientShape shape = m_shape;
- KisGradientPainter::enumGradientRepeat repeat = m_repeat;
- bool reverse = m_reverse;
- double antiAliasThreshold = m_antiAliasThreshold;
- bool dither = m_dither;
-
KUndo2MagicString actionName = kundo2_i18n("Gradient");
KisProcessingApplicator applicator(image, resources->currentNode(),
KisProcessingApplicator::NONE,
@@ -171,8 +162,9 @@ void KisToolGradient::endPrimaryAction(KoPointerEvent *event)
applicator.applyCommand(
new KisCommandUtils::LambdaCommand(
- [resources, startPos, endPos,
- shape, repeat, reverse, antiAliasThreshold, dither] () mutable {
+ [resources, startPos = m_startPos, endPos = m_endPos,
+ shape = m_shape, repeat = m_repeat, reverse = m_reverse,
+ antiAliasThreshold = m_antiAliasThreshold, dither = m_dither] () mutable {
KisNodeSP node = resources->currentNode();
KisPaintDeviceSP device = node->paintDevice();