Commit f71e035d authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fix continued transform of a piece added with Paste into Active Layer

parent 8cdf7856
...@@ -654,7 +654,7 @@ void KisToolTransform::setWarpPointDensity( int density ) ...@@ -654,7 +654,7 @@ void KisToolTransform::setWarpPointDensity( int density )
void KisToolTransform::initTransformMode(ToolTransformArgs::TransformMode mode) void KisToolTransform::initTransformMode(ToolTransformArgs::TransformMode mode)
{ {
m_currentArgs = KisTransformUtils::resetArgsForMode(mode, m_currentArgs.filterId(), m_transaction); m_currentArgs = KisTransformUtils::resetArgsForMode(mode, m_currentArgs.filterId(), m_transaction, m_currentArgs.externalSource());
initGuiAfterTransformMode(); initGuiAfterTransformMode();
} }
......
...@@ -504,13 +504,15 @@ void KisTransformUtils::setDefaultWarpPoints(int pointsPerLine, ...@@ -504,13 +504,15 @@ void KisTransformUtils::setDefaultWarpPoints(int pointsPerLine,
ToolTransformArgs KisTransformUtils::resetArgsForMode(ToolTransformArgs::TransformMode mode, ToolTransformArgs KisTransformUtils::resetArgsForMode(ToolTransformArgs::TransformMode mode,
const QString &filterId, const QString &filterId,
const TransformTransactionProperties &transaction) const TransformTransactionProperties &transaction,
KisPaintDeviceSP externalSource)
{ {
ToolTransformArgs args; ToolTransformArgs args;
args.setOriginalCenter(transaction.originalCenterGeometric()); args.setOriginalCenter(transaction.originalCenterGeometric());
args.setTransformedCenter(transaction.originalCenterGeometric()); args.setTransformedCenter(transaction.originalCenterGeometric());
args.setFilterId(filterId); args.setFilterId(filterId);
args.setExternalSource(externalSource);
if (mode == ToolTransformArgs::FREE_TRANSFORM) { if (mode == ToolTransformArgs::FREE_TRANSFORM) {
args.setMode(ToolTransformArgs::FREE_TRANSFORM); args.setMode(ToolTransformArgs::FREE_TRANSFORM);
......
...@@ -163,7 +163,7 @@ public: ...@@ -163,7 +163,7 @@ public:
static ToolTransformArgs resetArgsForMode(ToolTransformArgs::TransformMode mode, static ToolTransformArgs resetArgsForMode(ToolTransformArgs::TransformMode mode,
const QString &filterId, const QString &filterId,
const TransformTransactionProperties &transaction); const TransformTransactionProperties &transaction, KisPaintDeviceSP externalSource);
static bool shouldRestartStrokeOnModeChange(ToolTransformArgs::TransformMode oldMode, static bool shouldRestartStrokeOnModeChange(ToolTransformArgs::TransformMode oldMode,
ToolTransformArgs::TransformMode newMode, ToolTransformArgs::TransformMode newMode,
......
...@@ -428,8 +428,7 @@ void InplaceTransformStrokeStrategy::initStrokeCallback() ...@@ -428,8 +428,7 @@ void InplaceTransformStrokeStrategy::initStrokeCallback()
TransformTransactionProperties transaction(srcRect, &m_d->initialTransformArgs, m_d->rootNode, m_d->processedNodes); TransformTransactionProperties transaction(srcRect, &m_d->initialTransformArgs, m_d->rootNode, m_d->processedNodes);
if (!argsAreInitialized) { if (!argsAreInitialized) {
m_d->initialTransformArgs = KisTransformUtils::resetArgsForMode(m_d->mode, m_d->filterId, transaction); m_d->initialTransformArgs = KisTransformUtils::resetArgsForMode(m_d->mode, m_d->filterId, transaction, m_d->externalSource);
m_d->initialTransformArgs.setExternalSource(m_d->externalSource);
} }
m_d->externalSource.clear(); m_d->externalSource.clear();
......
...@@ -482,7 +482,7 @@ void TransformStrokeStrategy::initStrokeCallback() ...@@ -482,7 +482,7 @@ void TransformStrokeStrategy::initStrokeCallback()
TransformTransactionProperties transaction(srcRect, &initialTransformArgs, m_rootNode, m_processedNodes); TransformTransactionProperties transaction(srcRect, &initialTransformArgs, m_rootNode, m_processedNodes);
if (!argsAreInitialized) { if (!argsAreInitialized) {
initialTransformArgs = KisTransformUtils::resetArgsForMode(m_mode, m_filterId, transaction); initialTransformArgs = KisTransformUtils::resetArgsForMode(m_mode, m_filterId, transaction, 0);
} }
this->m_initialTransformArgs = initialTransformArgs; this->m_initialTransformArgs = initialTransformArgs;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment