]> git.lyx.org Git - lyx.git/commitdiff
#9130 Text in main work area isn't rendered with high resolution
authorStephan Witt <switt@lyx.org>
Tue, 21 Oct 2014 11:48:14 +0000 (13:48 +0200)
committerStephan Witt <switt@lyx.org>
Tue, 21 Oct 2014 11:48:14 +0000 (13:48 +0200)
Constify splash image coordinates

src/frontends/qt4/GuiView.cpp

index b690ac1bc2de9f5b387e394118fd8fed1b24ddfd..5f197c8f1910ad1397554ab0d52e71680ba75dd3 100644 (file)
@@ -160,38 +160,34 @@ public:
 
                QPainter pain(&splash_);
                pain.setPen(QColor(0, 0, 0));
+               double const multiplier = splashPixelRatio() / pixelRatio();
+               int const size = toqstr(lyxrc.font_sizes[FONT_SIZE_LARGE]).toDouble() * multiplier;
+               int const x = 190 * multiplier;
+               int const y = 225 * multiplier;
+               LYXERR(Debug::GUI,
+                       "widget pixel ratio: " << pixelRatio() <<
+                       " splash pixel ratio: " << splashPixelRatio() <<
+                       " version text size,position: " << size << "@" << x << "+" << y);
                QFont font;
                // The font used to display the version info
                font.setStyleHint(QFont::SansSerif);
                font.setWeight(QFont::Bold);
-               int size = int(toqstr(lyxrc.font_sizes[FONT_SIZE_LARGE]).toDouble());
-               size *= splashPixelRatio() / pixelRatio();
                font.setPointSize(size);
                pain.setFont(font);
-               int x = 190;
-               int y = 225;
-               x *= splashPixelRatio() / pixelRatio();
-               y *= splashPixelRatio() / pixelRatio();
-               LYXERR(Debug::GUI,
-                          "widget pixel ratio: " << pixelRatio() <<
-                          " splash pixel ratio: " << splashPixelRatio() <<
-                          " text position: @" << x << "+" << y);
                pain.drawText(x, y, text);
                setFocusPolicy(Qt::StrongFocus);
        }
 
        void paintEvent(QPaintEvent *)
        {
-               int w = splash_.width();
-               int h = splash_.height();
-               w /= splashPixelRatio();
-               h /= splashPixelRatio();
-               int x = (width() - w) / 2;
-               int y = (height() - h) / 2;
+               int const w = splash_.width() / splashPixelRatio();
+               int const h = splash_.height() / splashPixelRatio();
+               int const x = (width() - w) / 2;
+               int const y = (height() - h) / 2;
                LYXERR(Debug::GUI,
-                          "widget pixel ratio: " << pixelRatio() <<
-                          " splash pixel ratio: " << splashPixelRatio() <<
-                          " paint pixmap: " << w << "x" << h << "@" << x << "+" << y);
+                       "widget pixel ratio: " << pixelRatio() <<
+                       " splash pixel ratio: " << splashPixelRatio() <<
+                       " paint pixmap: " << w << "x" << h << "@" << x << "+" << y);
                QPainter pain(this);
                pain.drawPixmap(x, y, w, h, splash_);
        }