r21859 by jghali - #14707: Text preview truncated in Font Preview

scribus-commit scribus-commit at lists.scribus.net
Sat Apr 1 22:36:51 UTC 2017


Author: jghali
Date: Sat Apr  1 22:36:51 2017
New Revision: 21859

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21859
Log:
#14707: Text preview truncated in Font Preview

Modified:
    branches/Version14x/Scribus/scribus/sampleitem.cpp

Modified: branches/Version14x/Scribus/scribus/sampleitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21859&path=/branches/Version14x/Scribus/scribus/sampleitem.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/sampleitem.cpp	(original)
+++ branches/Version14x/Scribus/scribus/sampleitem.cpp	Sat Apr  1 22:36:51 2017
@@ -317,7 +317,14 @@
 
 	UndoManager::instance()->setUndoEnabled(false); // disable undo
 
-	PageItem_TextFrame *previewItem = new PageItem_TextFrame(m_Doc, 0, 0, width, height, 0, "__whiteforpreviewbg__", "__whiteforpreview__");
+	double frameWidth  = width;
+	double frameHeight = height;
+	if (m_Doc->view() != NULL)
+	{
+		frameWidth  /= PrefsManager::instance()->appPrefs.DisScale;
+		frameHeight /= PrefsManager::instance()->appPrefs.DisScale;
+	}
+	PageItem_TextFrame *previewItem = new PageItem_TextFrame(m_Doc, 0, 0, frameWidth, frameHeight, 0, "__whiteforpreviewbg__", "__whiteforpreview__");
 	QImage pm(width, height, QImage::Format_ARGB32);
 	ScPainter *painter = new ScPainter(&pm, width, height, 1.0, 0);
 	double sca = 1.0; // original scale to set back at the end...
@@ -349,7 +356,7 @@
 	previewItem->setFillShade(bgShade);
 	previewItem->SetRectFrame();
 	previewItem->Frame = false;
-	previewItem->DrawObj(painter, QRect());
+	previewItem->DrawObj(painter, QRect(0, 0, frameWidth, frameHeight));
 	painter->end();
 	delete(painter);
 	delete previewItem;




More information about the scribus-commit mailing list