Automatically create transform masks on layer types that cannot be transformed
Needs RevisionPublic

Authored by scottpetrovic on Wed, Feb 6, 7:15 PM.


Group Reviewers

This addresses this usability issue that is mentioned on this request

File Layer doesn't support transform tool, but leaves user guessing

This patch tries to grab all the layer types that run into this situation including group layers, file layers, and clone layers. If someone activates the transform tool when over these layer types, a new transform layer is automatically created as a child of it and selected.

Test Plan
  1. Add a group layer and put a paint layer in it. Then try to select the group layer and press Ctrl + T to activate the transform tool. Results: transform layer is created in group layer
  1. Add a file layer. Press Ctrl+T to activate the transform tool. Results: A transform layer is created as a child of the file layer
  1. Add a paint layer then clone it. Press Ctrl + T to activate the transform tool. Results: A transform layer is created as a child of the clone layer.

Diff Detail

R37 Krita
Lint Skipped
Unit Tests Skipped
scottpetrovic created this revision.Wed, Feb 6, 7:15 PM
Restricted Application added a project: Krita. ยท View Herald TranscriptWed, Feb 6, 7:15 PM
scottpetrovic requested review of this revision.Wed, Feb 6, 7:15 PM
dkazakov requested changes to this revision.Fri, Feb 8, 9:54 AM
dkazakov added a subscriber: dkazakov.

Hi, @scottpetrovic!

I'm sorry, but there are a few bugs in the patch:

  1. createAndUseTransformIfNeeded() should be called from startStroke(), not from activate(). activate() is called only once, when the tool is switched into, but startStroke() is called every time the user clicks om the canvas
  2. Group layers are successfully transformed by the transform tool, when the tool is in recursive mode. So it should be considered in the check.
  3. Creation of the mask should be created either with KisNodeCommandsAdapter (returned by KisNodeManager) or manually inside the transform stroke (very complicated). Right now the node is created without undo information, which breaks undo.
This revision now requires changes to proceed.Fri, Feb 8, 9:54 AM