Commit 4e958f77 authored by Claudio Valerio's avatar Claudio Valerio

hack dpi problem for pdf and texts

parent 48b67a91
...@@ -407,6 +407,8 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() ...@@ -407,6 +407,8 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
if (!pageDpi.isNull()) if (!pageDpi.isNull())
UBSettings::settings()->pageDpi->set(pageDpi.toString()); UBSettings::settings()->pageDpi->set(pageDpi.toString());
else
UBSettings::settings()->pageDpi->set(UBApplication::desktop()->physicalDpiX());
bool darkBackground = false; bool darkBackground = false;
bool crossedBackground = false; bool crossedBackground = false;
...@@ -719,7 +721,9 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() ...@@ -719,7 +721,9 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
{ {
QDesktopWidget* desktop = UBApplication::desktop(); QDesktopWidget* desktop = UBApplication::desktop();
qreal currentDpi = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2; qreal currentDpi = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
qDebug() << "currentDpi " << currentDpi;
qreal pdfScale = UBSettings::settings()->pageDpi->get().toReal()/currentDpi; qreal pdfScale = UBSettings::settings()->pageDpi->get().toReal()/currentDpi;
qDebug() << "pdfScale " << pdfScale;
pdfItem->setScale(pdfScale); pdfItem->setScale(pdfScale);
pdfItem->setFlag(QGraphicsItem::ItemIsMovable, true); pdfItem->setFlag(QGraphicsItem::ItemIsMovable, true);
pdfItem->setFlag(QGraphicsItem::ItemIsSelectable, true); pdfItem->setFlag(QGraphicsItem::ItemIsSelectable, true);
......
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