r16292 by fschmid - PDF-Export: fixed wrong bounding box for scaled symbol items.

scribus-commit scribus-commit at lists.scribus.net
Sat Jan 22 10:48:59 CET 2011


Author: fschmid
Date: Sat Jan 22 09:48:59 2011
New Revision: 16292

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16292
Log:
PDF-Export: fixed wrong bounding box for scaled symbol items.

Modified:
    trunk/Scribus/scribus/pdflib_core.cpp

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16292&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Sat Jan 22 09:48:59 2011
@@ -3390,15 +3390,31 @@
 	if (controlItem != NULL)
 	{
 		double scaleW, scaleH;
-		if (controlItem->groupWidth > controlItem->width())
-			scaleW = controlItem->groupWidth / controlItem->width();
-		else
-			scaleW = 1.0 / (controlItem->groupWidth / controlItem->width());
-		if (controlItem->groupHeight > controlItem->height())
-			scaleH = controlItem->groupHeight / controlItem->height();
-		else
-			scaleH = 1.0 / (controlItem->groupHeight / controlItem->height());
-		PutDoc("/BBox [ "+FToStr(0)+" "+FToStr(-controlItem->height() * scaleH)+" "+FToStr(controlItem->groupWidth * scaleW)+" "+FToStr(controlItem->groupHeight * scaleH)+" ]\n");
+		if (controlItem->isGroup())
+		{
+			if (controlItem->groupWidth > controlItem->width())
+				scaleW = controlItem->groupWidth / controlItem->width();
+			else
+				scaleW = 1.0 / (controlItem->groupWidth / controlItem->width());
+			if (controlItem->groupHeight > controlItem->height())
+				scaleH = controlItem->groupHeight / controlItem->height();
+			else
+				scaleH = 1.0 / (controlItem->groupHeight / controlItem->height());
+			PutDoc("/BBox [ "+FToStr(0)+" "+FToStr(-controlItem->height() * scaleH)+" "+FToStr(controlItem->groupWidth * scaleW)+" "+FToStr(controlItem->groupHeight * scaleH)+" ]\n");
+		}
+		if (controlItem->isSymbol())
+		{
+			ScPattern pat = doc.docPatterns[controlItem->pattern()];
+			if (pat.width > controlItem->width())
+				scaleW = pat.width / controlItem->width();
+			else
+				scaleW = 1.0 / (pat.width / controlItem->width());
+			if (pat.height > controlItem->height())
+				scaleH = pat.height / controlItem->height();
+			else
+				scaleH = 1.0 / (pat.height / controlItem->height());
+			PutDoc("/BBox [ "+FToStr(0)+" "+FToStr(-controlItem->height() * scaleH)+" "+FToStr(pat.width * scaleW)+" "+FToStr(pat.height * scaleH)+" ]\n");
+		}
 	}
 	else
 		PutDoc("/BBox [ "+FToStr(-bleedLeft)+" "+FToStr(-Options.bleeds.Bottom)+" "+FToStr(maxBoxX)+" "+FToStr(maxBoxY)+" ]\n");




More information about the scribus-commit mailing list