]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/PreviewImage.cpp
Fix bug #8258 (Zoom of editor doesn't zoom instant preview)
[lyx.git] / src / graphics / PreviewImage.cpp
index 7fe9f2a769303fa408d4df8f2048313973ed5cae..5eecfcc48a8f1a7add5a059b1726c9414e48ae10 100644 (file)
@@ -11,6 +11,8 @@
 #include <config.h>
 
 #include "PreviewImage.h"
+
+#include "Dimension.h"
 #include "GraphicsImage.h"
 #include "GraphicsLoader.h"
 #include "PreviewLoader.h"
@@ -103,6 +105,7 @@ PreviewImage::Impl::Impl(PreviewImage & p, PreviewLoader & l,
        : parent_(p), ploader_(l), iloader_(bf),
          snippet_(s), ascent_frac_(af)
 {
+       iloader_.setDisplayPixelRatio(l.displayPixelRatio());
        iloader_.connect(bind(&Impl::statusChanged, this));
 }
 
@@ -139,7 +142,10 @@ void PreviewImage::Impl::statusChanged()
        case ErrorUnknown:
                //iloader_.filename().removeFile();
                ploader_.remove(snippet_);
-               break;
+               // FIXME: We need to return here, because PreviewLoader::remove
+               // removes the preview image from the cache, which deletes this
+               // object, so we should not try to do anything here.
+               return;
 
        case Ready:
                iloader_.filename().removeFile();