Skip to content

Fix "safe" assert on selecting some blending brushes [present in current stable 5.0]

Before this commit, there was an assert thrown on notifyPageChange() in kis_colorsmudgeop_settings_widget, which means on both selecting a new blending brush or selecting another "page" of settings in a blending brush.

This is because it asks whether the brush tip is pierced, but when there is no brush tip, it asserts in kis_brush.cpp.

This commit fixes that.

There are two changes:

  • removal of the assert
  • checking for null in isPierced()

Test Plan

(Wet Circle brush is used because it has no brush tip image).

  • select "Wet Circle" blending brush in the brush editor before this MR and after.
  • select another page of configuration in the brush editor when having Wet Circle selected.

Questions

  1. Is it ok to remove the assert there? (If yes, I will remove the check for null before the brushTipImage() in isPierced(), I will only check for null afterwards using the image variable, it will be more in line with brushTipImage() being virtual).
  2. Why is the KisBrushSP not null while the brush tip itself is null/empty?

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 Agata Cacko

Merge request reports