View Issue Details

IDProjectCategoryView StatusLast Update
0009817ScribusUndo/Redopublic2011-03-10 21:53
Reportercezaryece Assigned Tocbradney  
PriorityhighSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.4.0svn 
Fixed in Version1.4.0svn 
Summary0009817: [BUG] unwanted undo state is created after selecting image frame with image sclaed to frame size
DescriptionThis happens after committing changes with undo for scaling changes in image frames.
Now if you for the fist time click on image frame with scaling to frame size than new unwanted undo state is created.

Problem is in PageItem::changeImageScaleUndoAction()
where seems to oldLocalScX is not equal with LocalScX and oldLocalScY is not equal with LocalScY.
Differences are very small (like 4.44089e-16) and depends on frame and image.
Small but make that "if ((oldLocalScX == LocalScX) && (oldLocalScY == LocalScY))" is not true on first selecting such frame and undo state is created.
TagsNo tags attached.
Patch

Activities

cezaryece

2011-03-08 10:53

updater  

fix_undo_scale.patch (728 bytes)   
Index: Scribus/scribus/pageitem.cpp
===================================================================
--- Scribus/scribus/pageitem.cpp	(wersja 16429)
+++ Scribus/scribus/pageitem.cpp	(kopia robocza)
@@ -3090,8 +3090,12 @@

 void PageItem::changeImageScaleUndoAction()
 {
-	if (oldLocalScX == LocalScX && oldLocalScY == LocalScY)
+	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())
        {
                SimpleState *ss = new SimpleState(Um::ImageScale,
fix_undo_scale.patch (728 bytes)   

cezaryece

2011-03-08 10:54

updater   ~0025764

Fix is weird but works.
Seems in SLA file saved scale values (or dimmensions) are in other precision.

Issue History

Date Modified Username Field Change
2011-03-08 10:32 cezaryece New Issue
2011-03-08 10:53 cezaryece File Added: fix_undo_scale.patch
2011-03-08 10:54 cezaryece Note Added: 0025764
2011-03-08 11:18 cbradney Status new => resolved
2011-03-08 11:18 cbradney Fixed in Version => 1.4.0svn
2011-03-08 11:18 cbradney Resolution open => fixed
2011-03-08 11:18 cbradney Assigned To => cbradney
2011-03-10 21:53 cbradney Status resolved => closed