]> git.lyx.org Git - features.git/commitdiff
Work-around for bug #5957.
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 26 Jul 2009 18:00:30 +0000 (18:00 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 26 Jul 2009 18:00:30 +0000 (18:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30794 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiImage.cpp

index 16ddeeca75c004c03bbc29566269a1a14f89c887..b004bdb547db992e9443ed914e6ed15f1395a941 100644 (file)
@@ -168,7 +168,17 @@ bool GuiImage::scale(Params const & params)
        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
+       // Due to a bug in Qt, LyX will crash when scaling an
+       // image with an odd height to 50%.
+       // see bug #5957: http://www.lyx.org/trac/ticket/5957
+       // FIXME: Add an upper version limit as soon as the bug is fixed in Qt.
+       if (params.scale == 50)
+               scale += 0.0001;
+#endif
+
        QMatrix m;
        m.scale(scale, scale);
        transformed_ = image.transformed(m);