Different angles in KisPaintInformation.angle
LukasT.dev@gmail.com
lukast.dev at gmail.com
Tue Apr 6 19:47:14 CEST 2010
Hello,
I'm working on hairy brush and I'm trying add rotation sensor to it.
I need KisPaintInformation as input for it.
When you implement paintOp, you have two possibilities, override
KisPaintOp::paintAt which sample the stroke into positions or override
KisPaintOp::paintLine which sample the stroke into line segments.
In Hairy brush I use paintLine version.
So far I compute the angle of the line that comes with paintLine call.
Basically I do
QPointF drag = (pi2 - pi1);
angle = atan2( drag.y, drag.x); // different variable names, but same code in
hairy_brush.cpp
But when I compare with value pi2.angle() which should have the same value,
I get difference. The pi2 is constructed the same way in KisToolFreehand where
we setup movement() and according the movement in KisPaintInformation the
angle is computed.
The difference I get is caused by smoothing. If I turn off the smoothing, the
pi2.angle() and angle I compute is the same.
Have you got idea what is wrong? Why pi2.angle() has different angle then when
I compute the angle of the line segment myself? Is that bug in smooting code?
Cheers
Lukas
More information about the kimageshop
mailing list