]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiImage.cpp
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiImage.cpp
index ceea8fc05b1e3fea9294fcb263b8656c4a4b6206..e7defe7ec585933bd5d3cb5dcd6e5230c5ecb97d 100644 (file)
@@ -165,10 +165,18 @@ bool GuiImage::scale(Params const & params)
 {
        QImage const & image = is_transformed_ ? transformed_ : original_;
 
-       if (params.scale < 0 || params.scale == 100)
+       if (params.scale == 100)
                return false;
 
-       qreal const scale = qreal(params.scale) / 100.0;
+       qreal scale = qreal(params.scale) / 100.0;
+
+#if (QT_VERSION >= 0x040500) && (QT_VERSION <= 0x040502)
+       // Due to a bug in Qt, LyX will crash for certain
+       // scaling factors and sizes of the image.
+       // see bug #5957: http://www.lyx.org/trac/ticket/5957
+       scale += 0.0001;
+#endif
+
        QMatrix m;
        m.scale(scale, scale);
        transformed_ = image.transformed(m);