Diffusion Krita 6eef8c4e2acc

Fix Move Tool to work correctly with Instant Preview

Authored by dkazakov on May 14 2020, 11:28 PM.

Description

Fix Move Tool to work correctly with Instant Preview

There were multiple problems:

  1. We couldn't search for a "node under cursor" in the GUI thread,

because Lod0 plane may be not ready yet (because currrently running
LodN stroke hasn't finished yet). Therefore, the node selection should
happen in the stroke itself.

  1. It leads to the fact that the stroke can be ended without doing

any work (when no nodes are found), hence we now have
MoveStrokeStrategy::sigStrokeStartedEmpty

  1. Since we don't have the list of nodes to process before the stroke

is actually started, we cannot properly decide whether we can use LodN
in MoveStrokeStrategy::createLodClone(). Therefore, we use pessimistic
approach there: if the tool uses "layer under cursor" and the image has
at least one non-lod-supporting node (e.g. a shape layer or a selection
mask), then LodN mode is disabled.

  1. The patch also fixes a bug in MoveSelectionStrokeStrategy, which

caused it to return wrong handles rect in LodN mode.

BUG:400484

Details