diff options
authorRobert Lancaster <[email protected]>2017-03-27 10:07:22 +0300
committerJasem Mutlaq <[email protected]>2017-03-27 10:07:22 +0300
commit84e2ce9db4f07eddb13b793ef5c3a08bc67ceaf7 (patch)
parentf42e950cd60e0fc38fb1a3052cd859daa5f86f61 (diff)
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:[email protected]
1 files changed, 1 insertions, 13 deletions
diff --git a/kstars/projections/projector.cpp b/kstars/projections/projector.cpp
index 9a2d6f6..74955d7 100644
--- a/kstars/projections/projector.cpp
+++ b/kstars/projections/projector.cpp
@@ -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