[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    Different angles in KisPaintInformation.angle
From:       "LukasT.dev () gmail ! com" <lukast ! dev () gmail ! com>
Date:       2010-04-06 17:47:14
Message-ID: 201004061947.14960.LukasT.dev () gmail ! com
[Download RAW message or body]

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



_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic