r17363 by fschmid - IDML Importer: correct placing of rotated frames.

scribus-commit scribus-commit at lists.scribus.net
Sat Mar 10 09:53:36 UTC 2012


Author: fschmid
Date: Sat Mar 10 09:53:36 2012
New Revision: 17363

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17363
Log:
IDML Importer: correct placing of rotated frames.

Modified:
    trunk/Scribus/scribus/plugins/import/idml/importidml.cpp

Modified: trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17363&path=/trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/idml/importidml.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/idml/importidml.cpp Sat Mar 10 09:53:36 2012
@@ -2236,6 +2236,11 @@
 					}
 				}
 			}
+			QRectF br = QRectF(0, 0, item->width(), item->height());
+			QTransform ma;
+			ma.rotate(-rot);
+			QRectF br2 = ma.mapRect(br);
+			item->moveBy(br.x() - br2.x(), br.y() - br2.y(), true);
 			item->setRotation(-rot, true);
 			item->OldB2 = item->width();
 			item->OldH2 = item->height();
@@ -2290,7 +2295,7 @@
 							m_Doc->loadPict(fileName, item);
 							item->setImageXYOffset(dxi - grOffset.x(), dyi - grOffset.y());
 							item->setImageXYScale(scXi / item->pixm.imgInfo.xres * 72, scYi / item->pixm.imgInfo.xres * 72);
-							item->setImageRotation(0);
+							item->setImageRotation(-roti);
 						}
 					}
 				}
@@ -2309,7 +2314,7 @@
 					m_Doc->loadPict(QUrl::fromPercentEncoding(fileName), item);
 					item->setImageXYScale(scXi / item->pixm.imgInfo.xres * 72, scYi / item->pixm.imgInfo.xres * 72);
 					item->setImageXYOffset((dxi - grOffset.x()) / item->imageXScale(), (dyi - grOffset.y()) / item->imageYScale());
-					item->setImageRotation(0);
+					item->setImageRotation(-roti);
 				}
 			}
 			GElements.append(m_Doc->Items->takeAt(z));




More information about the scribus-commit mailing list