From 4e958f77e6c327b452289e47119635970949991b Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 15 Aug 2013 14:51:47 +0200 Subject: [PATCH] hack dpi problem for pdf and texts --- src/adaptors/UBSvgSubsetAdaptor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 53a96fcf..a80ef091 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -407,6 +407,8 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() if (!pageDpi.isNull()) UBSettings::settings()->pageDpi->set(pageDpi.toString()); + else + UBSettings::settings()->pageDpi->set(UBApplication::desktop()->physicalDpiX()); bool darkBackground = false; bool crossedBackground = false; @@ -719,7 +721,9 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() { QDesktopWidget* desktop = UBApplication::desktop(); qreal currentDpi = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2; + qDebug() << "currentDpi " << currentDpi; qreal pdfScale = UBSettings::settings()->pageDpi->get().toReal()/currentDpi; + qDebug() << "pdfScale " << pdfScale; pdfItem->setScale(pdfScale); pdfItem->setFlag(QGraphicsItem::ItemIsMovable, true); pdfItem->setFlag(QGraphicsItem::ItemIsSelectable, true);