KisToolMove-Respect-Layer-Isolation-and-TODOs

The move tool should respect layer isolation setting and prevent moving hidden layers.

plugins/tools/basictools/kis_tool_move.cc

Without these changes, isolating the active layer does not prevent the move tool from manipulating inactive layers. Rather, the move tool may be used to manipulate any layer regardless of isolation status. This caveat was annotated by a TODO.

Furthermore, another TDOO existed in the move tool source code referencing a requirement to query the configuration file for a setting, but this seemed outdated as we already do the exact thing outlined in the TODO.

Test Plan

  • Run Krita
    • Any device
  • Create a new project
    • Default settings
  • Draw a simple square on the first layer
    • Not the background layer
    • "Layer 1" should automatically be generated upon project creation
  • Create a new layer
    • Should be "Layer 2"
    • Should be a paint layer
  • Draw a simple triangle on the new layer
  • Enable "Isolate active layer"
    • Important: remember where you left the square from Layer 1!
  • Activate Layer 2
    • Only the triangle should appear on the canvas
    • Everything else should be a black and white grid
  • Enable the move tool
    • Enable the "Move layer with content" tool setting
    • All other tool settings may remain default
  • Hover cursor over triangle on canvas
    • Cursor appearance should change to the move cursor
    • Move cursor should revert back to standard selector/click cursor when not hovered over triangle
  • Click and drag triangle along the canvas
    • Triangle's pixels should be translated along the canvas
    • Behavior should be identical to existing move tool functionality
  • Try and find the square from Layer 1
    • The square should still be invisible, because Layer 2 is still the active isolated layer
    • Cursor appearance should not change if you hover over the square
    • You should not be able to click and drag the square anywhere
  • Switch to Layer 1
    • Triangle should disappear
    • Square should appear
  • Click and drag square along the canvas
    • Square's pixels should be translated along the canvas
    • Behavior should be identical to existing move tool functionality
  • Try and find the triangle from Layer 2
    • The triangle should still be invisible, because Layer 2 is still the active isolated layer
    • Cursor appearance should not change if you hover over the triangle
    • You should not be able to click and drag the triangle anywhere

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
  • Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.

Edited by Ricky Ringler

Merge request reports

Loading