Commit 48b71100 authored by Albert Astals Cid's avatar Albert Astals Cid

Some more debug around this dpi stuff

parent 4c4825a2
......@@ -936,7 +936,9 @@ bool DocumentPrivate::openDocumentInternal( const KService::Ptr& offer, bool iss
QApplication::setOverrideCursor( Qt::WaitCursor );
m_generator->setDPI(Utils::realDpi(m_widget));
const QSizeF dpi = Utils::realDpi(m_widget);
kDebug() << "Output DPI:" << dpi;
m_generator->setDPI(dpi);
bool openOk = false;
if ( !isstdin )
......
......@@ -79,6 +79,7 @@ double Utils::realDpiX()
{
const QDesktopWidget* w = QApplication::desktop();
if (w->width() > 0 && w->widthMM() > 0) {
kDebug() << "Pix:" << w->width() << "MM:" << w->widthMM();
return (double(w->width()) * 25.4) / double(w->widthMM());
} else {
return dpiX();
......@@ -89,6 +90,7 @@ double Utils::realDpiY()
{
const QDesktopWidget* w = QApplication::desktop();
if (w->height() > 0 && w->heightMM() > 0) {
kDebug() << "Pix:" << w->height() << "MM:" << w->heightMM();
return (double(w->height()) * 25.4) / double(w->heightMM());
} else {
return dpiY();
......@@ -148,10 +150,17 @@ QSizeF Utils::realDpi(QWidget* widgetOnScreen)
kDebug() << "Output is vertical, transposing DPI rect";
res.transpose();
}
kDebug() << "Output DPI is " << res;
return res;
}
}
else
{
kDebug() << "Didn't find a KScreen selectedOutput to calculate DPI. Falling back";
}
}
else
{
kDebug() << "Didn't find a KScreen config to calculate DPI. Falling back";
}
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment