transform_stroke_strategy.cpp (krita-5.1.3.tar.xz) | : | transform_stroke_strategy.cpp (krita-5.1.4.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
#include "kis_transform_mask_adapter.h" | #include "kis_transform_mask_adapter.h" | |||
#include "kis_transform_utils.h" | #include "kis_transform_utils.h" | |||
#include "kis_abstract_projection_plane.h" | #include "kis_abstract_projection_plane.h" | |||
#include "kis_recalculate_transform_mask_job.h" | #include "kis_recalculate_transform_mask_job.h" | |||
#include "kis_lod_transform.h" | #include "kis_lod_transform.h" | |||
#include "kis_projection_leaf.h" | #include "kis_projection_leaf.h" | |||
#include "kis_modify_transform_mask_command.h" | #include "kis_modify_transform_mask_command.h" | |||
#include "kis_image_animation_interface.h" | #include "kis_image_animation_interface.h" | |||
#include "KisAnimAutoKey.h" | ||||
#include "kis_sequential_iterator.h" | #include "kis_sequential_iterator.h" | |||
#include "kis_selection_mask.h" | #include "kis_selection_mask.h" | |||
#include "kis_image_config.h" | #include "kis_image_config.h" | |||
#include "kis_layer_utils.h" | #include "kis_layer_utils.h" | |||
#include <QQueue> | #include <QQueue> | |||
#include <KisDeleteLaterWrapper.h> | #include <KisDeleteLaterWrapper.h> | |||
#include "transform_transaction_properties.h" | #include "transform_transaction_properties.h" | |||
#include "krita_container_utils.h" | #include "krita_container_utils.h" | |||
#include "commands_new/kis_saved_commands.h" | #include "commands_new/kis_saved_commands.h" | |||
#include "kis_command_ids.h" | #include "kis_command_ids.h" | |||
#include "KisRunnableStrokeJobUtils.h" | #include "KisRunnableStrokeJobUtils.h" | |||
#include "commands_new/KisHoldUIUpdatesCommand.h" | #include "commands_new/KisHoldUIUpdatesCommand.h" | |||
#include "KisDecoratedNodeInterface.h" | #include "KisDecoratedNodeInterface.h" | |||
#include "kis_paint_device_debug_utils.h" | #include "kis_paint_device_debug_utils.h" | |||
#include "kis_raster_keyframe_channel.h" | ||||
#include "kis_layer_utils.h" | #include "kis_layer_utils.h" | |||
TransformStrokeStrategy::TransformStrokeStrategy(ToolTransformArgs::TransformMod e mode, | TransformStrokeStrategy::TransformStrokeStrategy(ToolTransformArgs::TransformMod e mode, | |||
const QString &filterId, | const QString &filterId, | |||
bool forceReset, | bool forceReset, | |||
KisNodeSP rootNode, | KisNodeSP rootNode, | |||
KisSelectionSP selection, | KisSelectionSP selection, | |||
KisStrokeUndoFacade *undoFacade , | KisStrokeUndoFacade *undoFacade , | |||
KisUpdatesFacade *updatesFacade ) | KisUpdatesFacade *updatesFacade ) | |||
: KisStrokeStrategyUndoCommandBased(kundo2_i18n("Transform"), false, undoFac ade), | : KisStrokeStrategyUndoCommandBased(kundo2_i18n("Transform"), false, undoFac ade), | |||
skipping to change at line 448 | skipping to change at line 450 | |||
} else if (!m_forceReset && KisTransformUtils::tryInitArgsFromNode(m_rootNod e, &initialTransformArgs)) { | } else if (!m_forceReset && KisTransformUtils::tryInitArgsFromNode(m_rootNod e, &initialTransformArgs)) { | |||
argsAreInitialized = true; | argsAreInitialized = true; | |||
} | } | |||
QVector<KisStrokeJobData *> extraInitJobs; | QVector<KisStrokeJobData *> extraInitJobs; | |||
extraInitJobs << new Data(new KisHoldUIUpdatesCommand(m_updatesFacade, KisCo mmandUtils::FlipFlopCommand::INITIALIZING), false, KisStrokeJobData::BARRIER); | extraInitJobs << new Data(new KisHoldUIUpdatesCommand(m_updatesFacade, KisCo mmandUtils::FlipFlopCommand::INITIALIZING), false, KisStrokeJobData::BARRIER); | |||
extraInitJobs << lastCommandUndoJobs; | extraInitJobs << lastCommandUndoJobs; | |||
KritaUtils::addJobSequential(extraInitJobs, [this]() { | if (KisAutoKey::activeMode() > KisAutoKey::NONE) { | |||
// When dealing with animated transform mask layers, create keyframe and | KritaUtils::addJobSequential(extraInitJobs, [this]() { | |||
save the command for undo. | // When dealing with animated transform mask layers, create keyframe | |||
Q_FOREACH (KisNodeSP node, m_processedNodes) { | and save the command for undo. | |||
if (KisTransformMask* transformMask = dynamic_cast<KisTransformMask* | Q_FOREACH (KisNodeSP node, m_processedNodes) { | |||
>(node.data())) { | if (KisTransformMask* transformMask = dynamic_cast<KisTransformM | |||
QSharedPointer<KisInitializeTransformMaskKeyframesCommand> addKe | ask*>(node.data())) { | |||
yCommand(new KisInitializeTransformMaskKeyframesCommand(transformMask, transform | QSharedPointer<KisInitializeTransformMaskKeyframesCommand> a | |||
Mask->transformParams())); | ddKeyCommand(new KisInitializeTransformMaskKeyframesCommand(transformMask, trans | |||
runAndSaveCommand( addKeyCommand, KisStrokeJobData::CONCURRENT, | formMask->transformParams())); | |||
KisStrokeJobData::NORMAL); | runAndSaveCommand( addKeyCommand, KisStrokeJobData::CONCURRE | |||
NT, KisStrokeJobData::NORMAL); | ||||
} else if (node->hasEditablePaintDevice()){ | ||||
// Try to create a copy keyframe if available. | ||||
KisPaintDeviceSP device = node->paintDevice(); | ||||
KIS_ASSERT(device); | ||||
if (device->keyframeChannel()) { | ||||
KUndo2CommandSP undo(new KUndo2Command); | ||||
const int activeKeyframe = device->keyframeChannel()->ac | ||||
tiveKeyframeTime(); | ||||
const int targetKeyframe = node->image()->animationInter | ||||
face()->currentTime(); | ||||
device->keyframeChannel()->copyKeyframe(activeKeyframe, | ||||
targetKeyframe, undo.data()); | ||||
runAndSaveCommand(undo, KisStrokeJobData::BARRIER, KisSt | ||||
rokeJobData::NORMAL); | ||||
} | ||||
} | ||||
} | } | |||
} | }); | |||
}); | } | |||
KritaUtils::addJobSequential(extraInitJobs, [this]() { | KritaUtils::addJobSequential(extraInitJobs, [this]() { | |||
/** | /** | |||
* We must request shape layers to rerender areas outside image bounds | * We must request shape layers to rerender areas outside image bounds | |||
*/ | */ | |||
KisLayerUtils::forceAllHiddenOriginalsUpdate(m_rootNode); | KisLayerUtils::forceAllHiddenOriginalsUpdate(m_rootNode); | |||
}); | }); | |||
KritaUtils::addJobBarrier(extraInitJobs, [this]() { | KritaUtils::addJobBarrier(extraInitJobs, [this]() { | |||
/** | /** | |||
End of changes. 4 change blocks. | ||||
13 lines changed or deleted | 32 lines changed or added |