r19868 by fschmid - EMF-Import: fixed misplaced objects.

scribus-commit scribus-commit at lists.scribus.net
Mon Feb 23 20:08:46 UTC 2015


Author: fschmid
Date: Mon Feb 23 20:08:45 2015
New Revision: 19868

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19868
Log:
EMF-Import: fixed misplaced objects.

Modified:
    trunk/Scribus/scribus/plugins/import/emf/importemf.cpp

Modified: trunk/Scribus/scribus/plugins/import/emf/importemf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19868&path=/trunk/Scribus/scribus/plugins/import/emf/importemf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/emf/importemf.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/emf/importemf.cpp Mon Feb 23 20:08:45 2015
@@ -1630,8 +1630,8 @@
 QPointF EmfPlug::convertLogical2Pts(QPointF in)
 {
 	QPointF out;
-	double scaleX = (bBoxMM.width() / 1000.0 / 2.54 * 72.0) / bBoxDev.width(); // Device -> Pts
-	double scaleY = (bBoxMM.height() / 1000.0 / 2.54 * 72.0) / bBoxDev.height(); // Device -> Pts
+	double scaleX = qAbs((bBoxMM.width() / 1000.0 / 2.54 * 72.0) / bBoxDev.width()); // Device -> Pts
+	double scaleY = qAbs((bBoxMM.height() / 1000.0 / 2.54 * 72.0) / bBoxDev.height()); // Device -> Pts
 	if (currentDC.m_mapMode == 1)
 	{
 		out.setX(in.x() * scaleX);
@@ -1664,8 +1664,8 @@
 	}
 	else if ((currentDC.m_mapMode == 0x07) || (currentDC.m_mapMode == 0x08))
 	{
-		double ratioX = viewPextendX / static_cast<double>(winPextendX); // Logical --> Device
-		double ratioY = viewPextendY / static_cast<double>(winPextendY); // Logical --> Device
+		double ratioX = qAbs(viewPextendX / static_cast<double>(winPextendX)); // Logical --> Device
+		double ratioY = qAbs(viewPextendY / static_cast<double>(winPextendY)); // Logical --> Device
 		// logic --> device --> pts
 		out.setX(in.x() * ratioX * scaleX);
 		out.setY(in.y() * ratioY * scaleY);
@@ -2731,8 +2731,8 @@
 	QTransform bm = currentDC.m_WorldMap;
 	if ((currentDC.m_mapMode == 0x07) || (currentDC.m_mapMode == 0x08))
 	{
-		double ratioX = viewPextendX / static_cast<double>(winPextendX); // Logical --> Device
-		double ratioY = viewPextendY / static_cast<double>(winPextendY); // Logical --> Device
+		double ratioX = qAbs(viewPextendX / static_cast<double>(winPextendX)); // Logical --> Device
+		double ratioY = qAbs(viewPextendY / static_cast<double>(winPextendY)); // Logical --> Device
 		bm = QTransform(bm.m11() * ratioX, bm.m12() * ratioY, bm.m21() * ratioX, bm.m22() * ratioY, bm.dx() * ratioX, bm.dy() * ratioY);
 	}
 	QPointF p = currentDC.m_WorldMap.map(QPointF(dstX, dstY));




More information about the scribus-commit mailing list