Skip to content

Refactor the brush rotation option to work correctly with Pressure sensor (in [-180; +180] range)

The patchset changes the way how Brush Rotation option works, when the user activates any "pressure-like" sensor, that is "Pressure", "Distance", "Tilt Elevation" and so on. Bascially, it is a fix for bug 412111.

Now, when the user connects Pressure sensor to Rotation option, Pressure, instead of rotating the brush in range [0, 360] degrees, rotates the brush around its current angle in range [-180, 180].

Test Plan

  1. Create an asymmetrical brush, e.g. use predefined "spike_eroded" tip (with angle set to 270 deg).
  2. Activate Rotation and try the following modes:
  • Pressure
  • Tilt Direction
  • Rotation (needs Artpen)
  • Drawing Angle
  • Drawing Angle + Pressure (set strength to 30% to see the effect better)
  1. For every brush mode, try activate the following canvas transformations:
  • Rotate canvas (keys '4', '5' and '6')
  • Mirror canvas (key 'M')
  1. The brush behavior should look "sane" and "expected" :) Rotation, Tilt Direction and Drawing Angle should rotate the brush absolutely, not linked to the canvas transformations. Pressure should offset the rotation relative to its "base angle".
  2. Repeat (at least some of) the steps for Hue option. It should behave like Rotation.

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.

Merge request reports