View Issue Details

IDProjectCategoryView StatusLast Update
0012459ScribusUndo/Redopublic2015-03-03 15:49
ReporterFirasH Assigned Tocbradney  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx86_64OSopenSUSEOS Version13.1
Product Version1.5.0svn 
Target Version1.5.0Fixed in Version1.4.6.svn 
Summary0012459: Undo/Redo does not restore the correct position using Flip Horizontal/Vertical
DescriptionUndo/Redo does not restore the correct position using Flip Horizontal/Vertical.
Steps To Reproduce0) Create a new document
1) Insert 2 items (example: Text Frames with some text)
Do not create the items with the same size or position.

2) Select the 2 items and Properties > X,Y,Z > Flip Horizontal/Vertical
3) Undo step 2
The text is flipped back, but not the position of the 2 Text Frames.

Undo/Redo does not restore the previous position.
The position can be restored pressing again on Flip Horizontal/Vertical.
Additional InformationIssue present on:
Scribus 1.4.5.svn (19295)
Scribus 1.5.0.svn (19302)


Screencast: https://www.dropbox.com/s/pegmfdpia81ao7c/12459.mp4
TagsNo tags attached.
PatchNo

Relationships

child of 0012500 acknowledged Metabug: Undo/Redo (1.5.x.svn) 

Activities

Kunda

2014-07-16 23:38

updater   ~0032793

Confirmed 1.5svn r19342

Chelen

2015-03-01 21:50

developer  

patch.diff (1,942 bytes)   
diff --git a/scribus/pageitem_textframe.cpp b/scribus/pageitem_textframe.cpp
index 6c8046c..2fe371a 100644
--- a/scribus/pageitem_textframe.cpp
+++ b/scribus/pageitem_textframe.cpp
@@ -4831,7 +4831,7 @@ void PageItem_TextFrame::deleteSelectedTextFromFrame(/*bool findNotes*/)
 		//delete text
 		for (int i=start; i <= stop; ++i)
 		{
-			Mark* mark = i < itemText.length() && itemText.hasMark(i)? itemText.mark(i) : NULL;
+			Mark* mark = (i < itemText.length() && itemText.hasMark(i))? itemText.mark(i) : NULL;
 			const CharStyle& curParent = itemText.charStyle(i);
 			if (i==stop || !curParent.equiv(lastParent) || (mark!=NULL && mark->isType(MARKNoteFrameType)))
 			{
@@ -4927,7 +4927,7 @@ void PageItem_TextFrame::deleteSelectedTextFromFrame(/*bool findNotes*/)
 		}
 	}
 	else //remove marks without undo
-		marksNum =removeMarksFromText(false);
+		marksNum = removeMarksFromText(false);
 	itemText.setCursorPosition( start );
 	//for sure text is still selected
 	itemText.select(start, stop - start - marksNum);
diff --git a/scribus/scribusdoc.cpp b/scribus/scribusdoc.cpp
index 0043dec..8bb933c 100644
--- a/scribus/scribusdoc.cpp
+++ b/scribus/scribusdoc.cpp
@@ -11131,7 +11131,10 @@ void ScribusDoc::itemSelection_FlipH()
 		{
 			PageItem* currItem=m_Selection->itemAt(a);
 			currItem->getBoundingRect(&ix, &iy, &iw, &ih);
+
+			// Twice the length to center it in the current selection
 			double dx =  ((gw / 2.0) -  ((ix - gx) + (iw - ix) / 2.0)) * 2.0;
+
 			if (currItem->rotation() != 0.0)
 			{
 				double ix2, iy2, iw2, ih2;
@@ -11145,7 +11148,7 @@ void ScribusDoc::itemSelection_FlipH()
 				currItem->flipImageH();
 			if (currItem->itemType() != PageItem::Line)
 				MirrorPolyH(currItem);
-			currItem->moveBy(dx, 0, true);
+			currItem->moveBy(dx, 0, false);
 			currItem->GrStartX = currItem->width() - currItem->GrStartX;
 			currItem->GrEndX = currItem->width() - currItem->GrEndX;
 			if (currItem->isArc())
patch.diff (1,942 bytes)   

Chelen

2015-03-01 21:50

developer   ~0034629

I added a patch but I am not confortable anymore with scribus codebase so please tell me if I do something wrong.

FirasH

2015-03-03 15:49

developer   ~0034633

Thanks!
Fixed in 1.4.6.svn (19893) and 1.5.0.svn (19896).

Issue History

Date Modified Username Field Change
2014-07-01 13:50 FirasH New Issue
2014-07-09 01:15 FirasH Relationship added child of 0012500
2014-07-16 23:38 Kunda Note Added: 0032793
2014-07-16 23:38 Kunda Status new => confirmed
2014-07-16 23:38 Kunda Target Version => 1.5.1
2015-03-01 21:50 Chelen File Added: patch.diff
2015-03-01 21:50 Chelen Note Added: 0034629
2015-03-02 18:50 cbradney Status confirmed => resolved
2015-03-02 18:50 cbradney Fixed in Version => 1.5.0svn
2015-03-02 18:50 cbradney Resolution open => fixed
2015-03-02 18:50 cbradney Assigned To => cbradney
2015-03-02 18:52 cbradney Patch => No
2015-03-02 18:52 cbradney Target Version 1.5.1 => 1.5.0
2015-03-02 18:54 cbradney Fixed in Version 1.5.0svn => 1.4.6.svn
2015-03-03 15:49 FirasH Note Added: 0034633
2015-03-03 15:49 FirasH Status resolved => closed