[patch] Fix for ksnapshot preview cropping

Brad Hards bradh at frogmouth.net
Sun Feb 6 00:03:42 GMT 2005


http://bugs.kde.org/show_bug.cgi?id=93170 reports an issue with
ksnapshot preview (the little label shown in the top left hand part of the
window) being cropped.

No new strings. May I commit this?

Brad

--- ksnapshotwidget.ui.h        11 Dec 2004 21:40:39 -0000      1.5
+++ ksnapshotwidget.ui.h        5 Feb 2005 23:52:00 -0000
@@ -30,19 +30,22 @@ void KSnapshotWidget::setPreview( const
 {
     QImage img = pm.convertToImage();
     double r1 = ( ( double ) pm.height() ) / pm.width();
     if ( r1 * previewWidth()  < previewHeight() )
-        img = img.smoothScale(  previewWidth(), int( previewWidth() * r1 ) );
+        img = img.smoothScale(  previewWidth(),
+                               int( previewWidth() * r1 ),
+                               QImage::ScaleMin );
     else
         img = img.smoothScale( ( int ) ( ( ( double )previewHeight() ) / r1 ),
-        previewHeight() );
+                              previewHeight(), QImage::ScaleMin );

     QToolTip::remove( lblImage );
     QToolTip::add( lblImage,
         QString( "Preview of the snapshot image (%1 x %2)" )
         .arg( pm.width() ).arg( pm.height() ) );

     lblImage->setPixmap( img );
+    lblImage->adjustSize();
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050206/20f80b90/attachment.sig>


More information about the kde-core-devel mailing list