r15991 by christoph - Herm's patch to fix #8280

scribus-commit scribus-commit at lists.scribus.net
Thu Nov 25 23:48:06 CET 2010


Author: christoph
Date: Thu Nov 25 22:48:05 2010
New Revision: 15991

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15991
Log:
Herm's patch to fix #8280

Modified:
    trunk/Scribus/scribus/pageitem_latexframe.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp

Modified: trunk/Scribus/scribus/pageitem_latexframe.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15991&path=/trunk/Scribus/scribus/pageitem_latexframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_latexframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_latexframe.cpp Thu Nov 25 22:48:05 2010
@@ -188,37 +188,32 @@
 	imgValid = true;
 
 	//Save state and restore afterwards
-	bool do_update = PictureIsAvailable;
-	double scaleX = 72.0, scaleY = 72.0, offX = 0.0, offY = 0.0;
-	if (do_update) {
-		scaleX = LocalScX * pixm.imgInfo.xres;
-		scaleY = LocalScY * pixm.imgInfo.yres;
-		offX   = LocalX   / pixm.imgInfo.xres;
-		offY   = LocalY   / pixm.imgInfo.yres;
-	}
+	double xres, yres;
+	if (PictureIsAvailable)
+	{
+		xres = pixm.imgInfo.xres;
+		yres = pixm.imgInfo.yres;
+	}
+	else
+	{
+		xres = yres = realDpi();
+	}
+	double scaleX = LocalScX * xres;
+	double scaleY = LocalScY * yres;
+	double offX   = LocalX   / xres;
+	double offY   = LocalY   / yres;
 	PageItem_ImageFrame::loadImage(imageFile, true, realDpi());
 	if (PrefsManager::instance()->latexForceDpi()) 
 	{
 		pixm.imgInfo.xres = pixm.imgInfo.yres = realDpi();
 	}
 	
-	if (do_update) 
-	{
-		//Restoring parameters
-		LocalScX = scaleX / pixm.imgInfo.xres; //Account for dpi changes!
-		LocalScY = scaleY / pixm.imgInfo.yres;
-		LocalX   = offX   * pixm.imgInfo.xres;
-		LocalY   = offY   * pixm.imgInfo.yres;
-	} 
-	else 
-	{
-		//Setting sane defaults
-		LocalX = LocalY = 0;
-		LocalScX = 72.0/pixm.imgInfo.xres;
-		LocalScY = 72.0/pixm.imgInfo.yres;
-	}
-	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY );
-	
+	//Restore parameters, account for dpi changes
+	LocalScX = scaleX / pixm.imgInfo.xres;
+	LocalScY = scaleY / pixm.imgInfo.yres;
+	LocalX   = offX   * pixm.imgInfo.xres;
+	LocalY   = offY   * pixm.imgInfo.yres;
+	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY);
 	update();
 }
 

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15991&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Thu Nov 25 22:48:05 2010
@@ -2416,13 +2416,7 @@
 			currItem->CompressionMethodIndex = attrs.valueAsInt("COMPRESSIONMETHOD", 0);
 		if ((currItem->OverrideCompressionQuality = attrs.hasAttribute("COMPRESSIONQUALITY")))
 			currItem->CompressionQualityIndex = attrs.valueAsInt("COMPRESSIONQUALITY");
-		if (currItem->asLatexFrame())
-		{
-			currItem->setImageXYOffset(attrs.valueAsDouble("LOCALX") * scx, attrs.valueAsDouble("LOCALY") * scy);
-	//		currItem->setImageXYScale(1.0, 1.0);
-		}
-		else
-			currItem->setImageXYScale(scx, scy);
+		currItem->setImageXYScale(scx, scy);
 		currItem->setImageRotation(attrs.valueAsDouble("LOCALROT"));
 		clPath = attrs.valueAsString("ImageClip", "");
 		if (!clPath.isEmpty())




More information about the scribus-commit mailing list