StelPainter.cpp   StelPainter.cpp 
skipping to change at line 432 skipping to change at line 432
float cWidth = (float)getFontMetrics().width(ws)/ws.length(); float cWidth = (float)getFontMetrics().width(ws)/ws.length();
float xVc = prj->viewportCenter[0] + xshift; float xVc = prj->viewportCenter[0] + xshift;
float yVc = prj->viewportCenter[1] + yshift; float yVc = prj->viewportCenter[1] + yshift;
const float cosr = std::cos(-theta_o * M_PI/180.); const float cosr = std::cos(-theta_o * M_PI/180.);
const float sinr = std::sin(-theta_o * M_PI/180.); const float sinr = std::sin(-theta_o * M_PI/180.);
float xom = x + xshift*cosr - yshift*sinr; float xom = x + xshift*cosr - yshift*sinr;
float yom = y + yshift*sinr + yshift*cosr; float yom = y + yshift*sinr + yshift*cosr;
QString lang = StelApp::getInstance().getLocaleMgr().getAppLanguage( if (!StelApp::getInstance().getLocaleMgr().isAppRTL())
);
if (!QString("ar fa ckb ug ur he yi").contains(lang))
{ {
for (int i=0; i<ws.length(); ++i) for (int i=0; i<ws.length(); ++i)
{ {
if (d<limit) if (d<limit)
{ {
drawText(xom, yom, ws[i], -theta_o*180./M_PI +psi*i, 0., 0.); drawText(xom, yom, ws[i], -theta_o*180./M_PI +psi*i, 0., 0.);
xom += cWidth*std::cos(-theta_o+psi*i * M_PI /180.); xom += cWidth*std::cos(-theta_o+psi*i * M_PI /180.);
yom += cWidth*std::sin(-theta_o+psi*i * M_PI /180.); yom += cWidth*std::sin(-theta_o+psi*i * M_PI /180.);
} }
else else
skipping to change at line 540 skipping to change at line 539
void StelPainter::drawText(float x, float y, const QString& str, float angl eDeg, float xshift, float yshift, bool noGravity) void StelPainter::drawText(float x, float y, const QString& str, float angl eDeg, float xshift, float yshift, bool noGravity)
{ {
//StelPainter::GLState state; // Will restore the opengl state at th e end of the function. //StelPainter::GLState state; // Will restore the opengl state at th e end of the function.
if (prj->gravityLabels && !noGravity) if (prj->gravityLabels && !noGravity)
{ {
drawTextGravity180(x, y, str, xshift, yshift); drawTextGravity180(x, y, str, xshift, yshift);
} }
else if (qApp->property("text_texture")==true) // CLI option -t give n? else if (qApp->property("text_texture")==true) // CLI option -t give n?
{ {
//qDebug() << "Text texture" << str; //qDebug() << "Text texture" << str;
// This is taken from branch text-use-opengl-buffer. This is essential on devices like Raspberry Pi (2016-03). // This is taken from branch text-use-opengl-buffer. This is essential on devices like Raspberry Pi (2016-03).
StringTexture* tex = getTexTexture(str, currentFont.pixelSiz e()); StringTexture* tex = getTexTexture(str, currentFont.pixelSiz e());
Q_ASSERT(tex); Q_ASSERT(tex);
if (!noGravity) if (!noGravity)
angleDeg += prj->defaultAngleForGravityText; angleDeg += prj->defaultAngleForGravityText;
tex->texture->bind(); tex->texture->bind();
enableTexture2d(true); enableTexture2d(true);
static float vertexData[8]; static float vertexData[8];
// compute the vertex coordinates applying the translation a nd the rotation // compute the vertex coordinates applying the translation a nd the rotation
skipping to change at line 608 skipping to change at line 607
// painter.setFont(currentFont); // painter.setFont(currentFont);
QPainter painter(&device); QPainter painter(&device);
painter.beginNativePainting(); painter.beginNativePainting();
QFont tmpFont = currentFont; QFont tmpFont = currentFont;
tmpFont.setPixelSize(currentFont.pixelSize()*prj->getDeviceP ixelsPerPixel()*StelApp::getInstance().getGlobalScalingRatio()); tmpFont.setPixelSize(currentFont.pixelSize()*prj->getDeviceP ixelsPerPixel()*StelApp::getInstance().getGlobalScalingRatio());
painter.setFont(tmpFont); painter.setFont(tmpFont);
painter.setPen(QColor(currentColor[0]*255, currentColor[1]*2 55, currentColor[2]*255, currentColor[3]*255)); painter.setPen(QColor(currentColor[0]*255, currentColor[1]*2 55, currentColor[2]*255, currentColor[3]*255));
xshift*=StelApp::getInstance().getGlobalScalingRatio(); float scaleRatio = StelApp::getInstance().getGlobalScalingRa
yshift*=StelApp::getInstance().getGlobalScalingRatio(); tio();
xshift*=scaleRatio;
yshift*=scaleRatio;
y = prj->getViewportHeight()-y; y = prj->getViewportHeight()-y;
yshift = -yshift; yshift = -yshift;
// Translate/rotate // Translate/rotate
if (!noGravity) if (!noGravity)
angleDeg += prj->defaultAngleForGravityText; angleDeg += prj->defaultAngleForGravityText;
if (std::fabs(angleDeg)>1.f) if (std::fabs(angleDeg)>1.f)
{ {
 End of changes. 3 change blocks. 
6 lines changed or deleted 6 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/