r16265 by fschmid - PDF-Export: Fixed incorrect output of scaled groups.

scribus-commit scribus-commit at lists.scribus.net
Mon Jan 17 21:10:13 CET 2011


Author: fschmid
Date: Mon Jan 17 20:10:12 2011
New Revision: 16265

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16265
Log:
PDF-Export: Fixed incorrect output of scaled groups.

Modified:
    trunk/Scribus/scribus/pdflib_core.cpp

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16265&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Mon Jan 17 20:10:12 2011
@@ -3387,10 +3387,19 @@
 	getBleeds(ActPageP, bleedLeft, bleedRight);
 	double maxBoxX = ActPageP->width()+bleedRight+bleedLeft;
 	double maxBoxY = ActPageP->height()+Options.bleeds.Top+Options.bleeds.Bottom;
-	double scaleW = controlItem->groupWidth / controlItem->width();
-	double scaleH = controlItem->groupHeight / controlItem->height();
 	if (controlItem != NULL)
-		PutDoc("/BBox [ "+FToStr(0)+" "+FToStr(-controlItem->height() * scaleH)+" "+FToStr(controlItem->width() * scaleW)+" "+FToStr(controlItem->height() * scaleH)+" ]\n");
+	{
+		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");
+	}
 	else
 		PutDoc("/BBox [ "+FToStr(-bleedLeft)+" "+FToStr(-Options.bleeds.Bottom)+" "+FToStr(maxBoxX)+" "+FToStr(maxBoxY)+" ]\n");
 	PutDoc("/Group "+QString::number(Gobj)+" 0 R\n");




More information about the scribus-commit mailing list