[Kstars-devel] kdeedu/kstars/kstars
Jason Harris
kstars at 30doradus.org
Tue Jan 4 15:18:14 CET 2005
CVS commit by harris:
Fixing bug #96260 (Angular ruler line doesn't update when moving with
arrow keys).
The Angular ruler geometry is now changed in a new function,
SkyMap::updateAngleRuler(). This is called in drawOverlays() if
isAngleMode() is true. The result: the angular ruler line is updated
whenever the sky is changed (by mouse, arrow keys, the passing of time,
etc.)
(BTW, to the bug reporter: your report implies that the line appears at
startup, which should not happen. That's an old bug that has been
fixed)
CCMAIL: 96260-done at bugs.kde.org
CCMAIL: kstars-devel at kde.org
M +8 -0 skymap.cpp 1.150
M +6 -1 skymap.h 1.67
M +3 -1 skymapdraw.cpp 1.74
M +0 -14 skymapevents.cpp 1.98
--- kdeedu/kstars/kstars/skymap.cpp #1.149:1.150
@@ -1330,3 +1330,11 @@ void SkyMap::addLink( void ) {
}
+void SkyMap::updateAngleRuler() {
+ if ( Options::useAltAz() ) PreviousClickedPoint.EquatorialToHorizontal( data->LST, data->geo()->lat() );
+ beginRulerPoint = getXY( previousClickedPoint(), Options::useAltAz(), Options::useRefraction() );
+
+// endRulerPoint = QPoint(e->x(), e->y());
+ endRulerPoint = mapFromGlobal( QCursor::pos() );
+}
+
#include "skymap.moc"
--- kdeedu/kstars/kstars/skymap.h #1.66:1.67
@@ -369,4 +369,9 @@ public:
bool isAngleMode() const {return angularDistanceMode;}
+/**@short update the geometry of the angle ruler
+ */
+ void updateAngleRuler();
+
+
/**@return true if the object currently has a user label attached.
*@note this function only checks for a label explicitly added to the object
--- kdeedu/kstars/kstars/skymapdraw.cpp #1.73:1.74
@@ -60,7 +60,9 @@ void SkyMap::drawOverlays( QPixmap *pm )
drawZoomBox( p );
if ( transientObject() ) drawTransientLabel( p );
- if (isAngleMode())
+ if (isAngleMode()) {
+ updateAngleRuler();
drawAngleRuler( p );
}
+ }
}
--- kdeedu/kstars/kstars/skymapevents.cpp #1.97:1.98
@@ -429,18 +429,4 @@ void SkyMap::mouseMoveEvent( QMouseEvent
}
- // Are we in angularDistanceMode?: Then draw a line
- if ( isAngleMode() ) {
-
- // We put this instruction here so that the first point of the
- // ruler is recomputed when moving the mouse. The initial
- // point of the ruler may change if the time step is high.
-
- if ( Options::useAltAz() ) PreviousClickedPoint.EquatorialToHorizontal( data->LST, data->geo()->lat() );
- beginRulerPoint = getXY( previousClickedPoint(), Options::useAltAz(), Options::useRefraction() );
-
- endRulerPoint = QPoint(e->x(), e->y());
- }
-
-
//Are we dragging an infoBox?
if ( infoBoxes()->dragBox( e ) ) {
More information about the Kstars-devel
mailing list