[Digikam-devel] branches/stable/extragear/graphics/digikam/utilities/imageeditor

Gilles Caulier caulier.gilles at free.fr
Sun Dec 4 17:34:25 GMT 2005


SVN commit 485500 by cgilles:

Digikam 0.8.x from stable : patch from Anders Lund for making printing possible/faster
CCMAIL: digikam-devel at kde.org, anders at alweb.dk

 M  +9 -7      imageprint.cpp  


--- branches/stable/extragear/graphics/digikam/utilities/imageeditor/imageprint.cpp #485499:485500
@@ -226,6 +226,8 @@
     int w = metrics.width();
     int h = metrics.height();
 
+    QSize size = m_image.size();
+
     bool printFilename = m_printer.option( "app-imageeditor-printFilename" ) != f;
     if ( printFilename )
     {
@@ -238,7 +240,7 @@
     {
         
         // Scale image to fit pagesize
-        m_image = m_image.smoothScale( w, h, QImage::ScaleMin );
+        size.scale( w, h, QSize::ScaleMin );
     }
     else
     {
@@ -260,7 +262,7 @@
             hresize  = (int)(metrics.logicalDpiY() * hunit);
         }
 
-        m_image = m_image.smoothScale( wresize, hresize, QImage::ScaleMin );
+        size.scale( wresize, hresize, QSize::ScaleMin );
     }
 
     // Align image.
@@ -280,22 +282,22 @@
 
     // x - alignment
     if ( alignment & Qt::AlignHCenter )
-        x = (w - m_image.width())/2;
+        x = (w - size.width())/2;
     else if ( alignment & Qt::AlignLeft )
         x = 0;
     else if ( alignment & Qt::AlignRight )
-        x = w - m_image.width();
+        x = w - size.width();
 
     // y - alignment
     if ( alignment & Qt::AlignVCenter )
-        y = (h - m_image.height())/2;
+        y = (h - size.height())/2;
     else if ( alignment & Qt::AlignTop )
         y = 0;
     else if ( alignment & Qt::AlignBottom )
-        y = h - m_image.height();
+        y = h - size.height();
 
     // Perform the actual drawing.
-    p.drawImage( x, y, m_image );
+    p.drawImage( QRect( x, y, size.width(), size.height()), m_image );;
 
     if ( printFilename )
     {



More information about the Digikam-devel mailing list