r16431 by craig - #9817: Hack for rounding issue due to text conversion. Reduce scale/offset set calls

scribus-commit scribus-commit at lists.scribus.net
Tue Mar 8 12:18:46 CET 2011


Author: craig
Date: Tue Mar  8 11:18:46 2011
New Revision: 16431

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16431
Log:
#9817: Hack for rounding issue due to text conversion. Reduce scale/offset set calls

Modified:
    branches/Version135/Scribus/scribus/pageitem.cpp

Modified: branches/Version135/Scribus/scribus/pageitem.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16431&path=/branches/Version135/Scribus/scribus/pageitem.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/pageitem.cpp (original)
+++ branches/Version135/Scribus/scribus/pageitem.cpp Tue Mar  8 11:18:46 2011
@@ -3090,7 +3090,11 @@
 
 void PageItem::changeImageScaleUndoAction()
 {
-	if (oldLocalScX == LocalScX && oldLocalScY == LocalScY)
+	//#9817: Hack for this rounding issue caused by conversion to text values. Undo needs fixing.
+	if ((ScCLocale::toDoubleC(ScCLocale::toQStringC(oldLocalScX)) ==
+		ScCLocale::toDoubleC(ScCLocale::toQStringC(LocalScX)))
+		&& (ScCLocale::toDoubleC(ScCLocale::toQStringC(oldLocalScY)) ==
+		ScCLocale::toDoubleC(ScCLocale::toQStringC(LocalScY))))
 		return;
 	if (UndoManager::undoEnabled())
 	{
@@ -3711,10 +3715,8 @@
 			setImageFlippedH(is->getBool("FLIPPH"));
 			setImageFlippedV(is->getBool("FLIPPV"));
 			setImageScalingMode(is->getBool("SCALING"), is->getBool("ASPECT"));
-			setImageXOffset(is->getDouble("XOFF"));
-			setImageXScale(is->getDouble("XSCALE"));
-			setImageYOffset(is->getDouble("YOFF"));
-			setImageYScale(is->getDouble("YSCALE"));
+			setImageXYOffset(is->getDouble("XOFF"), is->getDouble("YOFF"));
+			setImageXYScale(is->getDouble("XSCALE"), is->getDouble("YSCALE"));
 			setFillTransparency(is->getDouble("FILLT"));
 			setLineTransparency(is->getDouble("LINET"));
 		}




More information about the scribus-commit mailing list