Skip to content

Fix isometric grid drawing with and without offsets

Before, the isometric grid made not really much sense.

  • it didn't seem to start at the start of the canvas
  • one of the offset worked the exact opposite, and the other was working diagonally, with just one coordinate working "the correct way".

Now I believe it makes more sense:

  • both angles start at the same point (0,0), which makes sense to the user
  • both offset works on the crosses between lines, moving them downwards and rightwards as the user expects (since it works the same way with rectangular grid).

Before (two colors of the grid and the grid outside of the canvas is just to0 help understand the situation; the canvas area is the white rectangle): Zrzut_ekranu_z_2020-11-28_01-07-56 After: Zrzut_ekranu_z_2020-11-28_19-07-46

Also offsets: (here X offset 20 px, Y offset 0 px) Zrzut_ekranu_z_2020-11-29_16-10-27

Test Plan

  • open isometric_grid_002.kra
  • see the grid with 0 px offsets
  • see with 0 and 500, and 500 and 0, and 500 and 500 - the grid should still show up on the canvas
  • see if the angles are calculated correctly too

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

Loading