digikam/digikam-print.diff

41 lines
1.5 KiB
Diff

Index: digikam/utilities/imageeditor/tools/imageprint.cpp
===================================================================
--- digikam/utilities/imageeditor/tools/imageprint.cpp.orig
+++ digikam/utilities/imageeditor/tools/imageprint.cpp
@@ -156,18 +156,9 @@ bool ImagePrint::printImageWithQt()
// when the orientation is decided.
w = metrics.width();
h = metrics.height();
- int filenameOffset = 0;
QSize size = image2Print.size();
- bool printFilename = m_printer.option( "app-imageeditor-printFilename" ) != f;
- if ( printFilename )
- {
- // filename goes into one line!
- filenameOffset = fm.lineSpacing() + 14;
- h -= filenameOffset;
- }
-
if ( m_printer.option( "app-imageeditor-scaleToFit" ) != f )
{
if ( m_printer.option( "app-imageeditor-auto-rotate" ) == t )
@@ -248,6 +239,7 @@ bool ImagePrint::printImageWithQt()
// Perform the actual drawing.
p.drawImage( QRect( x, y, size.width(), size.height()), image2Print );
+ bool printFilename = m_printer.option( "app-imageeditor-printFilename" ) != f;
if ( printFilename )
{
QString fname = minimizeString( d->filename, fm, w );
@@ -256,6 +248,8 @@ bool ImagePrint::printImageWithQt()
{
int fw = fm.width( fname );
int x = (w - fw)/2;
+ // filename goes into one line!
+ int filenameOffset = fm.lineSpacing() + 14;
int y = metrics.height() - filenameOffset/2;
p.drawText( x, y, fname );
}