Skip to content

Change Document::createFilterMask API to require either a Selection or a Node...

Victor Wåhlström requested to merge victorw/krita:b395000 into master

Document::createFilterMask now requires passing in a selection or a node from which a selection can be initialized, so that Krita doesn't crash when the created FilterMask is later parented to a node.

Test Plan

Try running this modified script from the bug report (https://bugs.kde.org/show_bug.cgi?id=395000):

from krita import *

k = Krita.instance()
w = Krita.instance().activeWindow()
v = w.activeView()
d = v.document()

selected_nodes = v.selectedNodes()
filter = k.filter('hsvadjustment')

for n in selected_nodes:
    fm = d.createFilterMask("SHS[Blacken]", filter, n)
    n.addChildNode(fm, None)

You can also create a Selection() object and pass it to createFilterMask instead of a node.

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 Victor Wåhlström

Merge request reports

Loading