Skip to content

Draft: Add single-axis settings to Wrap Around Mode

Attempting to add some degree of support for Wrap Around Mode wrapping in a single (horizontal or vertical) direction, as opposed to only both directions.

There's likely things I haven't tested that still need to be handled.

Thread on Krita Artists

Test Plan

Added to the View menu, below "Wrap Around Mode" is a "Wrap Around Mode Direction" submenu with three options: "Wrap Around Both Directions", "Wrap Around Horizontally", "Wrap Around Vertically". But I had to manually edit my local krita5.xmlgui for this to show up?

Things I've specifically tested:

Should restrict wrapping to one axis:

  • Viewing image
  • Viewing transparency checkers
  • Drawing on image
  • Drawing with Spray Engine brush (uses RandomAccessor)
  • Move Tool: Moving in Wraparound has an existing oddity where it copies parts of the image to outside the image bounds, which is not undoable.
  • Oilpaint Filter (and others) (uses LineIterator)
  • Smudging with Color Smudge Engine brush: Restricts writing to one axis, but not reading, which is how it behaves with selections.

Should be able to tell whether the click was on the single-direction-wrapped image:

  • Fill Tool
  • Color Selector Tool: Currently returns color on top or left edge of image if out of bounds.
  • Screen Color Selector (under the simple color selector)

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