]> git.lyx.org Git - lyx.git/commitdiff
avoid float-conversion warning and simplify size computation
authorStephan Witt <switt@lyx.org>
Fri, 22 May 2015 19:53:37 +0000 (21:53 +0200)
committerStephan Witt <switt@lyx.org>
Fri, 22 May 2015 20:00:22 +0000 (22:00 +0200)
src/frontends/qt4/GuiView.cpp

index 8ce28113537d34f3704cdabe45b767f3b64562ea..e6fda91d11eb26864e7eaa55946f28a00f7e1e38 100644 (file)
@@ -236,24 +236,18 @@ private:
 #endif
        }
 
-       qreal fontSize() {
+       qreal fontSize() const {
                return toqstr(lyxrc.font_sizes[FONT_SIZE_LARGE]).toDouble();
        }
 
-       QPointF textPosition() {
-               return QPointF(splashWidth()/2 - 16, splashHeigth() - 40);
+       QPointF textPosition() const {
+               return QPointF(width_/2 - 16, height_ - 40);
        }
 
-       QSize splashSize() {
-               return  QSize(width_ * pixelRatio(),height_ * pixelRatio());
-       }
-
-       double splashWidth() {
-               return splash_.width()/splashPixelRatio();
-       }
-
-       double splashHeigth() {
-               return splash_.height()/splashPixelRatio();
+       QSize splashSize() const {
+               return  QSize(
+                       static_cast<unsigned int>(width_ * pixelRatio()),
+                       static_cast<unsigned int>(height_ * pixelRatio()));
        }
 
        /// Ratio between physical pixels and device-independent pixels of splash image