r22417 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Mon Feb 26 19:50:18 UTC 2018


Author: jghali
Date: Mon Feb 26 19:50:18 2018
New Revision: 22417

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22417
Log:
#15172: double-click + keyboard adjusting image frames doesn't set "free scaling"

Modified:
    trunk/Scribus/scribus/pageitem_imageframe.cpp

Modified: trunk/Scribus/scribus/pageitem_imageframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22417&path=/trunk/Scribus/scribus/pageitem_imageframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_imageframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_imageframe.cpp	Mon Feb 26 19:50:18 2018
@@ -49,6 +49,7 @@
 
 #include "undomanager.h"
 #include "undostate.h"
+#include "undotransaction.h"
 #include "util_formats.h"
 #include "util_color.h"
 #include "util.h"
@@ -325,29 +326,36 @@
 				break;
 			default:
 				return;
-		}		
-		if (dX!=0.0)
-		{
-			double newXScale=dX / 100.0 * m_imageXScale;
+		}
+		UndoTransaction transaction;
+		if (UndoManager::undoEnabled())
+		{
+			if (fitImageToFrame() && (dX != 0.0 || dY != 0.0))
+				transaction = undoManager->beginTransaction(getUName(), getUPixmap(), Um::ImageScale, "", Um::IMove);
+		}
+		if (dX != 0.0)
+		{
+			double newXScale = dX / 100.0 * m_imageXScale;
+			setImageScalingMode(true, AspectRatio);
 			setImageXScale(newXScale);
 			if (!controlDown)
 			{
-				double newYScale=dX / 100.0 * m_imageYScale;
+				double newYScale = dX / 100.0 * m_imageYScale;
 				setImageYScale(newYScale);
 			}
 		}
-		else
-		if (dY!=0.0)
-		{
-			double newYScale=dY / 100.0 * m_imageYScale;
+		else if (dY != 0.0)
+		{
+			double newYScale = dY / 100.0 * m_imageYScale;
+			setImageScalingMode(true, AspectRatio);
 			setImageYScale(newYScale);
 			if (!controlDown)
 			{
-				double newXScale=dY / 100.0 * m_imageYScale;
+				double newXScale = dY / 100.0 * m_imageYScale;
 				setImageXScale(newXScale);
 			}
 		}
-		if (dX!=0.0 || dY!=0.0)
+		if (dX != 0.0 || dY != 0.0)
 			if (imageClip.size() != 0)
 			{
 				imageClip = pixm.imgInfo.PDSpathData[pixm.imgInfo.usedPath].copy();
@@ -357,6 +365,8 @@
 				cl.scale(imageXScale(), imageYScale());
 				imageClip.map(cl);
 			}
+		if (transaction)
+			transaction.commit();
 		update();	
 	}
 }




More information about the scribus-commit mailing list