PointerCoordinates.cpp   PointerCoordinates.cpp 
skipping to change at line 141 skipping to change at line 141
Vec3d win; Vec3d win;
prj->project(mousePosition,win); prj->project(mousePosition,win);
float dx = prj->getViewportPosX()+wh+mx - win.v[0]; float dx = prj->getViewportPosX()+wh+mx - win.v[0];
float dy = prj->getViewportPosY()+hh+1-my - win.v[1]; float dy = prj->getViewportPosY()+hh+1-my - win.v[1];
coordsValid = prj->unProject(prj->getViewportPosX()+wh+mx+dx , prj->getViewportPosY()+hh+1-my+dy, mousePosition); coordsValid = prj->unProject(prj->getViewportPosX()+wh+mx+dx , prj->getViewportPosY()+hh+1-my+dy, mousePosition);
} }
if (!coordsValid) if (!coordsValid)
return; return;
bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDe grees(); bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDe grees();
bool useOldAzimuth = StelApp::getInstance().getFlagOldAzimuthUsage() ; bool useSouthAzimuth = StelApp::getInstance().getFlagSouthAzimuthUsa ge();
QString coordsSystem, cxt, cyt; QString coordsSystem, cxt, cyt;
double cx, cy; double cx, cy;
switch (getCurrentCoordinateSystem()) switch (getCurrentCoordinateSystem())
{ {
case RaDecJ2000: case RaDecJ2000:
{ {
StelUtils::rectToSphe(&cx,&cy,mousePosition); // Cal culate RA/DE (J2000.0) and show it... StelUtils::rectToSphe(&cx,&cy,mousePosition); // Cal culate RA/DE (J2000.0) and show it...
coordsSystem = qc_("RA/Dec (J2000.0)", "abbreviated in the plugin"); coordsSystem = qc_("RA/Dec (J2000.0)", "abbreviated in the plugin");
if (withDecimalDegree) if (withDecimalDegree)
skipping to change at line 183 skipping to change at line 183
{ {
cxt = StelUtils::radToHmsStr(cx, true); cxt = StelUtils::radToHmsStr(cx, true);
cyt = StelUtils::radToDmsStr(cy, true); cyt = StelUtils::radToDmsStr(cy, true);
} }
break; break;
} }
case AltAzi: case AltAzi:
{ {
StelUtils::rectToSphe(&cy,&cx,core->j2000ToAltAz(mou sePosition, StelCore::RefractionAuto)); StelUtils::rectToSphe(&cy,&cx,core->j2000ToAltAz(mou sePosition, StelCore::RefractionAuto));
float direction = 3.; // N is zero, E is 90 degrees float direction = 3.; // N is zero, E is 90 degrees
if (useOldAzimuth) if (useSouthAzimuth)
direction = 2.; direction = 2.;
cy = direction*M_PI - cy; cy = direction*M_PI - cy;
if (cy > M_PI*2) if (cy > M_PI*2)
cy -= M_PI*2; cy -= M_PI*2;
coordsSystem = qc_("Az/Alt", "abbreviated in the plu gin"); coordsSystem = qc_("Az/Alt", "abbreviated in the plu gin");
if (withDecimalDegree) if (withDecimalDegree)
{ {
cxt = StelUtils::radToDecDegStr(cy); cxt = StelUtils::radToDecDegStr(cy);
cyt = StelUtils::radToDecDegStr(cx); cyt = StelUtils::radToDecDegStr(cx);
skipping to change at line 286 skipping to change at line 286
break; break;
} }
} }
QString coordsText = QString("%1: %2/%3").arg(coordsSystem).arg(cxt) .arg(cyt); QString coordsText = QString("%1: %2/%3").arg(coordsSystem).arg(cxt) .arg(cyt);
sPainter.drawText(getCoordinatesPlace(coordsText).first, getCoordina tesPlace(coordsText).second, coordsText); sPainter.drawText(getCoordinatesPlace(coordsText).first, getCoordina tesPlace(coordsText).second, coordsText);
} }
void PointerCoordinates::enableCoordinates(bool b) void PointerCoordinates::enableCoordinates(bool b)
{ {
flagShowCoordinates = b; if (b!=flagShowCoordinates)
{
flagShowCoordinates = b;
emit flagCoordinatesVisibilityChanged(b);
}
} }
double PointerCoordinates::getCallOrder(StelModuleActionName actionName) co nst double PointerCoordinates::getCallOrder(StelModuleActionName actionName) co nst
{ {
if (actionName==StelModule::ActionDraw) if (actionName==StelModule::ActionDraw)
return StelApp::getInstance().getModuleMgr().getModule("Land scapeMgr")->getCallOrder(actionName)+10.; return StelApp::getInstance().getModuleMgr().getModule("Land scapeMgr")->getCallOrder(actionName)+10.;
return 0; return 0;
} }
bool PointerCoordinates::configureGui(bool show) bool PointerCoordinates::configureGui(bool show)
 End of changes. 3 change blocks. 
3 lines changed or deleted 7 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/