]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/PreviewImage.cpp
Better naming for enums
[lyx.git] / src / graphics / PreviewImage.cpp
index b80bf9415b5175bdabf77d1e50b2af144e733137..b31af6fbd946d109eb875bedb2a03b0b9d996219 100644 (file)
@@ -19,6 +19,7 @@
 #include "PreviewLoader.h"
 
 #include "support/FileName.h"
+#include "support/lyxlib.h"
 
 
 using namespace std;
@@ -35,7 +36,7 @@ public:
        ///
        ~Impl();
        ///
-       Image const * image();
+       Image const * image() const;
        ///
        void statusChanged();
 
@@ -85,7 +86,7 @@ Dimension PreviewImage::dim() const
        if (!image)
                return dim;
 
-       dim.asc = int(pimpl_->ascent_frac_ * double(image->height()) + 0.5);
+       dim.asc = support::iround(pimpl_->ascent_frac_ * double(image->height()));
        dim.des = image->height() - dim.asc;
        dim.wid = image->width();
        return dim;
@@ -125,7 +126,7 @@ PreviewImage::Impl::~Impl()
 }
 
 
-Image const * PreviewImage::Impl::image()
+Image const * PreviewImage::Impl::image() const
 {
        if (iloader_.status() == WaitingToLoad)
                iloader_.startLoading();