PointerCoordinates.cpp   PointerCoordinates.cpp 
skipping to change at line 131 skipping to change at line 131
sPainter.setFont(font); sPainter.setFont(font);
QPoint p = StelMainView::getInstance().getMousePos(); // get screen coordinates of mouse cursor QPoint p = StelMainView::getInstance().getMousePos(); // get screen coordinates of mouse cursor
Vec3d mousePosition; Vec3d mousePosition;
float wh = prj->getViewportWidth()/2.; // get half of width of the s creen float wh = prj->getViewportWidth()/2.; // get half of width of the s creen
float hh = prj->getViewportHeight()/2.; // get half of height of the screen float hh = prj->getViewportHeight()/2.; // get half of height of the screen
float mx = p.x()-wh; // point 0 in center of the screen, axis X dire cted to right float mx = p.x()-wh; // point 0 in center of the screen, axis X dire cted to right
float my = p.y()-hh; // point 0 in center of the screen, axis Y dire cted to bottom float my = p.y()-hh; // point 0 in center of the screen, axis Y dire cted to bottom
// calculate position of mouse cursor via position of center of the screen (and invert axis Y) // calculate position of mouse cursor via position of center of the screen (and invert axis Y)
// If coordinates are invalid, don't draw them. // If coordinates are invalid, don't draw them.
bool coordsValid=false; bool coordsValid = prj->unProject(prj->getViewportPosX()+wh+mx, prj-
coordsValid = prj->unProject(prj->getViewportPosX()+wh+mx, prj->getV >getViewportPosY()+hh+1-my, mousePosition);
iewportPosY()+hh+1-my, mousePosition); if (coordsValid)
{ // Nick Fedoseev patch { // Nick Fedoseev patch
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); prj->unProject(prj->getViewportPosX()+wh+mx+dx, prj->getView portPosY()+hh+1-my+dy, mousePosition);
} }
if (!coordsValid) else
return; return;
bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDe grees(); bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDe grees();
bool useSouthAzimuth = StelApp::getInstance().getFlagSouthAzimuthUsa ge(); 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:
skipping to change at line 168 skipping to change at line 168
} }
else else
{ {
cxt = StelUtils::radToHmsStr(cx, true); cxt = StelUtils::radToHmsStr(cx, true);
cyt = StelUtils::radToDmsStr(cy, true); cyt = StelUtils::radToDmsStr(cy, true);
} }
break; break;
} }
case RaDec: case RaDec:
{ {
StelUtils::rectToSphe(&cx,&cy,core->j2000ToEquinoxEq u(mousePosition)); // Calculate RA/DE and show it... StelUtils::rectToSphe(&cx,&cy,core->j2000ToEquinoxEq u(mousePosition, StelCore::RefractionOff)); // Calculate RA/DE and show it. ..
coordsSystem = qc_("RA/Dec", "abbreviated in the plu gin"); coordsSystem = qc_("RA/Dec", "abbreviated in the plu gin");
if (withDecimalDegree) if (withDecimalDegree)
{ {
cxt = StelUtils::radToDecDegStr(cx, 5, false , true); cxt = StelUtils::radToDecDegStr(cx, 5, false , true);
cyt = StelUtils::radToDecDegStr(cy); cyt = StelUtils::radToDecDegStr(cy);
} }
else else
{ {
cxt = StelUtils::radToHmsStr(cx, true); cxt = StelUtils::radToHmsStr(cx, true);
cyt = StelUtils::radToDmsStr(cy, true); cyt = StelUtils::radToDmsStr(cy, true);
skipping to change at line 240 skipping to change at line 240
else else
{ {
cxt = StelUtils::radToDmsStr(cx, true); cxt = StelUtils::radToDmsStr(cx, true);
cyt = StelUtils::radToDmsStr(cy, true); cyt = StelUtils::radToDmsStr(cy, true);
} }
break; break;
} }
case Ecliptic: case Ecliptic:
{ {
double lambda, beta; double lambda, beta;
StelUtils::rectToSphe(&cx,&cy,core->j2000ToEquinoxEq u(mousePosition)); StelUtils::rectToSphe(&cx,&cy,core->j2000ToEquinoxEq u(mousePosition, StelCore::RefractionOff));
StelUtils::equToEcl(cx, cy, core->getCurrentPlanet() ->getRotObliquity(core->getJDE()), &lambda, &beta); // Calculate ecliptic p osition and show it... StelUtils::equToEcl(cx, cy, core->getCurrentPlanet() ->getRotObliquity(core->getJDE()), &lambda, &beta); // Calculate ecliptic p osition and show it...
if (lambda<0) lambda+=2.0*M_PI; if (lambda<0) lambda+=2.0*M_PI;
coordsSystem = qc_("Ecl. Long/Lat", "abbreviated in the plugin"); coordsSystem = qc_("Ecl. Long/Lat", "abbreviated in the plugin");
if (withDecimalDegree) if (withDecimalDegree)
{ {
cxt = StelUtils::radToDecDegStr(lambda); cxt = StelUtils::radToDecDegStr(lambda);
cyt = StelUtils::radToDecDegStr(beta); cyt = StelUtils::radToDecDegStr(beta);
} }
else else
{ {
 End of changes. 5 change blocks. 
7 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/