Commit 84e2ce9d authored by Robert Lancaster's avatar Robert Lancaster Committed by Jasem Mutlaq

I found the drawing issue that was making the horizontal bar for different...

I found the drawing issue that was making the horizontal bar for different pixel heights of the window.  It took me some time to dig up what exactly was causing the black line.  But I finally did.

It was a result of clipping that was taking place in Skymapqdraw.cpp:

    // Set Clipping
    QPainterPath path;
    path.addPolygon(m_SkyMap->projector()->clipPoly());
    psky.setClipPath(path);
    psky.setClipping(true);

Which was based upon some code in Projector.cpp in the method void Projector::updateClipPoly()

The issue was that in creating the clip path, it was stepping around the circle from 0 to 180 degrees and then from 0 to -180 degrees.  As a result, it created not a circular clipping region but two semicircular clipping regions.   I painted the path so that I could clearly see what was going on:

Then I tried reversing the direction for the second half circle from -180 to 0.  This did not work, it produced an unbounded clipping region.

But then I tried doing a full circular path from 0 to 360.  This not only gave a circular path, it worked perfectly for the clipping region and fixed the problem.

Now what I don’t know is whether the reason for two separate half circles was based upon some issue with the sincos method accurately calculating the other half of the circle.  The reason I suspect this is because someone went to a lot of trouble to write two separate loops that are nearly identical.

As far as I can tell, this method works, please check for me.

CCMAIL:kstars-devel@kde.org
parent f42e950c
......@@ -389,7 +389,7 @@ void Projector::updateClipPoly()
double r = m_vp.zoomFactor*radius();
double t1 = 0 ;
double t2 = 180;
double t2 = 360;
double inc=1.0;
for ( double t=t1; t <= t2; t += inc )
{
......@@ -399,18 +399,6 @@ void Projector::updateClipPoly()
a.SinCos( sa, ca );
m_clipPolygon << QPointF( 0.5*m_vp.width + r*ca, 0.5*m_vp.height - r*sa);
}
t1 =0 ;
t2 =- 180.;
for ( double t=t1; t >= t2; t -= inc )
{
//step along circumference
dms a( t );
double sa(0.), ca(0.);
a.SinCos( sa, ca );
m_clipPolygon << QPointF( 0.5*m_vp.width + r*ca, 0.5*m_vp.height - r*sa);
}
}
QPolygonF Projector::clipPoly() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment