Fix isotropic spacing when working on a mirrored canvas
ClosedPublic

Authored by dkazakov on Nov 18 2016, 4:29 PM.

Details

Summary

BUG:372545

Test Plan

This patch touches rotation and mirroring capabilities of the brushes. These
parameters depend on both, brush and canvas rotation/mirroring capabilities,
so they should be tested in complex.

  1. Test with rotated (or drawing angle) brushes
  2. Test with mirrored (including using sensor) brushes
  3. Test with rotated canvas
  4. Test with mirrored canvas
  5. Test with all combinations of the above :)

The general idea of canvas rotation/mirroring is:

Whenever you rotate or mirror the canvas, brush shape *doesn't* change
its shape from your point of view. That is if you paint with a
vertical rectangular brush, the brush should still stay vertical
whenever you rotate/miror the canvas. In other words, the brush shape
is linked to your stylus tip, not to the canvas.

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dkazakov updated this revision to Diff 8311.Nov 18 2016, 4:29 PM
dkazakov retitled this revision from to Fix isotropic spacing when working on a mirrored canvas.
dkazakov updated this object.
dkazakov edited the test plan for this revision. (Show Details)
dkazakov added reviewers: Krita, woltherav, timotheegiet.
timotheegiet edited edge metadata.Nov 20 2016, 11:12 AM

Test result: everything in the test plan works fine :)
The only little annoying detail is when rotating, the brush outline cursor is rotated until it gets some input/starts moving.

Also, I was hoping this would fix the rotation bug with tilt, but it doesn't..
Could you please take a look at it?
https://bugs.kde.org/show_bug.cgi?id=366289
https://bugs.kde.org/show_bug.cgi?id=369451
(I also pasted the duplicate bug link as my comments there are important...)

Oh, and as I said on irc, I had a build error : ‘M_PI’ was not declared in this scope .
So I added
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

in kis_distance_information.h to make it build.

dkazakov updated this revision to Diff 8342.Nov 21 2016, 10:58 AM
dkazakov edited edge metadata.
  • Fix KisBrushOpTest
  • Fix Tilt-elevation to work with rotated/mirrored canvas
  • Fix compilation due to undefined M_PI on some compilers

Hi, @timotheegiet!

I've fixed the tilt-rotation bug you mentioned. Please test and report if it really fixes the problem for you! :)

timotheegiet accepted this revision.Nov 21 2016, 11:59 AM
timotheegiet edited edge metadata.

Yay! Works perfectly, tilt problem solved. Congrats!
Please ship it :)

(tested on 3.1 branch only...)

This revision is now accepted and ready to land.Nov 21 2016, 11:59 AM
This revision was automatically updated to reflect the committed changes.