Skip to content

Improve color drag & drop on the canvas

This MR extends the color drag annd drop on canvas feature.

Before the whole layer was filled with the color. Now if no keyboard modifier is pressed, the behavior is the same. But if control is pressed then only the closed area under the cursor in the active layer is filled. If shift is also pressed then the image projection is used as reference instead of the current layer.

NOTE: The modifier choices are kind of arbitrary. Maybe is better to use the "fill closed area under cursor" as default (no modifier pressed)? I have no preference.


  • Now the filling is performed with the current fill tool options.
  • If the color labeled option is chosen then it defaults to the current layer, since the color labels are not stored in the config.
  • If alt modifier is pressed then the "fill selection" option is forced (as in the fill tool).
  • Added some checks:
    • If the active layer can not be painted, a floating message is shown saying so and the filling is aborted.
    • If the active layer is locked or not visible, a floating message is shown saying so and the filling is aborted. Before one could fill the layer even if it was locked or not visible.

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.
Edited by Deif Lou

Merge request reports