[Kst] branches/work/kst/viewaspect/kst/src/libkstapp
Duncan Hanson
duncan.hanson at gmail.com
Tue May 30 19:47:42 CEST 2006
SVN commit 546668 by dhanson:
fix crash for invalid pictures- do not call restoreAspect.
M +3 -6 kstviewpicture.cpp
--- branches/work/kst/viewaspect/kst/src/libkstapp/kstviewpicture.cpp #546667:546668
@@ -216,14 +216,12 @@
if (ti.load(tmpFile)) {
setImage(ti);
_url = source;
+
+ if (_maintainAspect == true) { restoreAspect(); }
} else {
success = false;
}
- if (_maintainAspect == true) {
- restoreAspect();
- }
-
KIO::NetAccess::removeTempFile(tmpFile);
return success;
}
@@ -307,14 +305,13 @@
void KstViewPicture::restoreAspect() {
QRect cr(contentsRect());
QSize size = _image.size(); //start with original size.
-
+
size.scale( cr.size().width(), cr.size().height(), QSize::ScaleMin ); //find largest rect. which will fit inside original and still preserve aspect.
cr.setSize(size);
setContentsRect(cr);
}
-
QMap<QString, QVariant> KstViewPicture::widgetHints(const QString& propertyName) const {
QMap<QString, QVariant> map = KstBorderedViewObject::widgetHints(propertyName);
if (!map.empty()) {
More information about the Kst
mailing list