View Issue Details

IDProjectCategoryView StatusLast Update
0008860ScribusGeneralpublic2016-10-18 19:34
Reporterale Assigned ToFirasH  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.3.5svn 
Target Version1.5.3Fixed in Version1.5.3.svn 
Summary0008860: Resizing with Alt or Alt+Shift and arrows is wrong when rotation is applied to an Item
Description- create a text frame
- rotate it 90°
- alt+right moves the top margin
- alt+left moves the bottom margin
- alt-up resizes the and right margin and moves half as much the frame up an right
- alt-down moves the right margin
- alt-shift-right and alt-shift-down do funny things
- alt-shift-left and alt-shift-up are just inverted.
Additional Informationhappens with the 1.3.5svn from the scribus deb repository and with a current 1.5svn
Tagsresize, rotate, shortcuts
PatchYes

Relationships

related to 0012118 closedjghali Resizing rotated items going over 0 width/height behaves strangely 
related to 0003612 closedjghali Changing width or height of rotated items behaves inconsistently depending on basepoint 
related to 0013563 confirmed Resizing 2 items (one of which is rotated) leads to wrong canvas placement (semi-fixed) 

Activities

FirasH

2014-07-20 21:54

reporter   ~0032843

Confirming with 1.5.0.svn (19357)

Mazoon

2015-11-09 12:20

reporter   ~0037343

I believe this is related to 0003612 and 0012118.

FirasH

2016-10-02 20:33

reporter   ~0042079

Currently working on this.
The idea is to use arrows relatively to the rotation of the item.

FirasH

2016-10-07 23:15

reporter   ~0042105

Completed and tested all the necessary code, please look at 8860-Patch.diff

The patch manages items rotation and image x and y position inside an Image Frame to keep it "still" while increasing/decreasing frame dimensions.

Now the behaviour is more user-frendly and, as previously:
1) Alt + Arrow: increases dimension along the direction of the arrow key
2) Alt + Shift + Arrow: decreases dimension along the direction of the arrow key

Please test and report, thanks!

FirasH

2016-10-08 19:24

reporter   ~0042107

Fixed tabs indentation and reuploaded the patch.

FirasH

2016-10-08 20:35

reporter  

8860-Patch.diff (6,861 bytes)   

diff --git a/scribus/canvasmode.cpp b/scribus/canvasmode.cpp
--- a/scribus/canvasmode.cpp
+++ b/scribus/canvasmode.cpp
@@ -1295,6 +1295,7 @@
 			bool resizing=((buttonModifiers & Qt::AltModifier) && !(buttonModifiers & Qt::ControlModifier));
 			bool resizingsmaller=(resizing && (buttonModifiers & Qt::ShiftModifier));
 			double resizeBy=1.0;
+
 			//CB with control locked out due to the requirement of moveby of 0.01, we cannot support
 			//resizeby 10 units unless we move to supporting modifier keys that most people don't have.
 			//if (buttonModifiers & Qt::ControlModifier)
@@ -1304,6 +1305,14 @@
 				resizeBy*=-1.0;
 
 			PageItem *currItem = m_doc->m_Selection->itemAt(0);
+
+			//#8860
+			//rotationFC is a temporary variable to manage items rotation:
+			//currently an item with e.g. 40° rotation is as 360° - 40° = 320°
+			double rotationFC = fabs(360.0 - currItem->rotation());
+			//radRotation calculates item rotation in rad
+			double radRotation = rotationFC * M_PI / 180.0;
+
 			switch (kk)
 			{
 			case Qt::Key_Backspace:
@@ -1379,13 +1388,27 @@
 							m_view->TransformPoly(10, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else if (!currItem->sizeLocked())
 						{
-							if (!resizingsmaller)
+							if ((rotationFC > 0.0 && rotationFC < 45.0) || (rotationFC >= 315.0 && rotationFC <= 360.0))
 							{
-								m_doc->moveItem(-resizeBy, 0, currItem);
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+								m_doc->moveItem(-resizeBy * cos(radRotation), resizeBy * sin(radRotation), currItem);
 								currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
 							}
+							else if (rotationFC >= 45.0 && rotationFC < 135.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+								m_doc->moveItem(-resizeBy * sin(radRotation), -resizeBy * cos(radRotation), currItem);
+								currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
+							}
+							else if (rotationFC >= 135.0 && rotationFC < 225.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+							}
+							else if (rotationFC >= 225.0 && rotationFC < 315.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+							}
 							currItem->Sizing = false;
-							m_doc->sizeItem(currItem->width()+resizeBy, currItem->height(), currItem);
 						}
 					}
 					currItem->update();
@@ -1453,13 +1476,27 @@
 							m_view->TransformPoly(11, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else if (!currItem->sizeLocked())
 						{
-							if (resizingsmaller)
+							if ((rotationFC > 0.0 && rotationFC < 45.0) || (rotationFC > 315.0 && rotationFC <= 360.0))
 							{
-								m_doc->moveItem(-resizeBy, 0, currItem);
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+							}
+							else if (rotationFC >= 45.0 && rotationFC < 135.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+							}
+							else if (rotationFC >= 135.0 && rotationFC < 225.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+								m_doc->moveItem(-resizeBy * cos(radRotation), resizeBy * sin(radRotation), currItem);
 								currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
 							}
+							else if (rotationFC >= 225.0 && rotationFC < 315.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+								m_doc->moveItem(-resizeBy * sin(radRotation), -resizeBy * cos(radRotation), currItem);
+								currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
+							}
 							currItem->Sizing = false;
-							m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
 						}
 					}
 					currItem->update();
@@ -1527,13 +1564,27 @@
 							m_view->TransformPoly(12, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else
 						{
-							if (!resizingsmaller)
+							if ((rotationFC > 0.0 && rotationFC < 45.0) || (rotationFC >= 315.0 && rotationFC <= 360.0))
 							{
-								m_doc->moveItem(0, -resizeBy, currItem);
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+								m_doc->moveItem(-resizeBy * sin(radRotation), -resizeBy * cos(radRotation), currItem);
 								currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
 							}
+							else if (rotationFC >= 45.0 && rotationFC < 135.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+							}
+							else if (rotationFC >= 135.0 && rotationFC < 225.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+							}
+							else if (rotationFC >= 225.0 && rotationFC < 315.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+								m_doc->moveItem(-resizeBy * cos(radRotation), resizeBy * sin(radRotation), currItem);
+								currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
+							}
 							currItem->Sizing = false;
-							m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
 						}
 					}
 					currItem->update();
@@ -1601,13 +1652,27 @@
 							m_view->TransformPoly(13, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else if (!currItem->sizeLocked())
 						{
-							if (resizingsmaller)
+							if ((rotationFC > 0.0 && rotationFC < 45.0) || (rotationFC >= 315.0 && rotationFC <= 360.0))
 							{
-								m_doc->moveItem(0, -resizeBy, currItem);
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+							}
+							else if (rotationFC >= 45.0 && rotationFC < 135.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+								m_doc->moveItem(-resizeBy * cos(radRotation), resizeBy * sin(radRotation), currItem);
+								currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
+							}
+							else if (rotationFC >= 135.0 && rotationFC < 225.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+								m_doc->moveItem(-resizeBy * sin(radRotation), -resizeBy * cos(radRotation), currItem);
 								currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
 							}
+							else if (rotationFC >= 225.0 && rotationFC < 315.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+							}
 							currItem->Sizing = false;
-							m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
 						}
 					}
 					currItem->update();
8860-Patch.diff (6,861 bytes)   

FirasH

2016-10-09 11:41

reporter   ~0042109

Found a very small typo:
... (rotationFC > 315.0 && ...
should be:
... (rotationFC >= 315.0 && ...

Uploaded 8860-PatchV2.diff that fixes it.
8860-PatchV2.diff (6,862 bytes)   

diff --git a/scribus/canvasmode.cpp b/scribus/canvasmode.cpp
--- a/scribus/canvasmode.cpp
+++ b/scribus/canvasmode.cpp
@@ -1295,6 +1295,7 @@
 			bool resizing=((buttonModifiers & Qt::AltModifier) && !(buttonModifiers & Qt::ControlModifier));
 			bool resizingsmaller=(resizing && (buttonModifiers & Qt::ShiftModifier));
 			double resizeBy=1.0;
+
 			//CB with control locked out due to the requirement of moveby of 0.01, we cannot support
 			//resizeby 10 units unless we move to supporting modifier keys that most people don't have.
 			//if (buttonModifiers & Qt::ControlModifier)
@@ -1304,6 +1305,14 @@
 				resizeBy*=-1.0;
 
 			PageItem *currItem = m_doc->m_Selection->itemAt(0);
+
+			//#8860
+			//rotationFC is a temporary variable to manage items rotation:
+			//currently an item with e.g. 40° rotation is as 360° - 40° = 320°
+			double rotationFC = fabs(360.0 - currItem->rotation());
+			//radRotation calculates item rotation in rad
+			double radRotation = rotationFC * M_PI / 180.0;
+
 			switch (kk)
 			{
 			case Qt::Key_Backspace:
@@ -1379,13 +1388,27 @@
 							m_view->TransformPoly(10, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else if (!currItem->sizeLocked())
 						{
-							if (!resizingsmaller)
+							if ((rotationFC > 0.0 && rotationFC < 45.0) || (rotationFC >= 315.0 && rotationFC <= 360.0))
 							{
-								m_doc->moveItem(-resizeBy, 0, currItem);
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+								m_doc->moveItem(-resizeBy * cos(radRotation), resizeBy * sin(radRotation), currItem);
 								currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
 							}
+							else if (rotationFC >= 45.0 && rotationFC < 135.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+								m_doc->moveItem(-resizeBy * sin(radRotation), -resizeBy * cos(radRotation), currItem);
+								currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
+							}
+							else if (rotationFC >= 135.0 && rotationFC < 225.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+							}
+							else if (rotationFC >= 225.0 && rotationFC < 315.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+							}
 							currItem->Sizing = false;
-							m_doc->sizeItem(currItem->width()+resizeBy, currItem->height(), currItem);
 						}
 					}
 					currItem->update();
@@ -1453,13 +1476,27 @@
 							m_view->TransformPoly(11, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else if (!currItem->sizeLocked())
 						{
-							if (resizingsmaller)
+							if ((rotationFC > 0.0 && rotationFC < 45.0) || (rotationFC >= 315.0 && rotationFC <= 360.0))
 							{
-								m_doc->moveItem(-resizeBy, 0, currItem);
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+							}
+							else if (rotationFC >= 45.0 && rotationFC < 135.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+							}
+							else if (rotationFC >= 135.0 && rotationFC < 225.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+								m_doc->moveItem(-resizeBy * cos(radRotation), resizeBy * sin(radRotation), currItem);
 								currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
 							}
+							else if (rotationFC >= 225.0 && rotationFC < 315.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+								m_doc->moveItem(-resizeBy * sin(radRotation), -resizeBy * cos(radRotation), currItem);
+								currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
+							}
 							currItem->Sizing = false;
-							m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
 						}
 					}
 					currItem->update();
@@ -1527,13 +1564,27 @@
 							m_view->TransformPoly(12, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else
 						{
-							if (!resizingsmaller)
+							if ((rotationFC > 0.0 && rotationFC < 45.0) || (rotationFC >= 315.0 && rotationFC <= 360.0))
 							{
-								m_doc->moveItem(0, -resizeBy, currItem);
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+								m_doc->moveItem(-resizeBy * sin(radRotation), -resizeBy * cos(radRotation), currItem);
 								currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
 							}
+							else if (rotationFC >= 45.0 && rotationFC < 135.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+							}
+							else if (rotationFC >= 135.0 && rotationFC < 225.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+							}
+							else if (rotationFC >= 225.0 && rotationFC < 315.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+								m_doc->moveItem(-resizeBy * cos(radRotation), resizeBy * sin(radRotation), currItem);
+								currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
+							}
 							currItem->Sizing = false;
-							m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
 						}
 					}
 					currItem->update();
@@ -1601,13 +1652,27 @@
 							m_view->TransformPoly(13, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else if (!currItem->sizeLocked())
 						{
-							if (resizingsmaller)
+							if ((rotationFC > 0.0 && rotationFC < 45.0) || (rotationFC >= 315.0 && rotationFC <= 360.0))
 							{
-								m_doc->moveItem(0, -resizeBy, currItem);
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+							}
+							else if (rotationFC >= 45.0 && rotationFC < 135.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+								m_doc->moveItem(-resizeBy * cos(radRotation), resizeBy * sin(radRotation), currItem);
+								currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
+							}
+							else if (rotationFC >= 135.0 && rotationFC < 225.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+								m_doc->moveItem(-resizeBy * sin(radRotation), -resizeBy * cos(radRotation), currItem);
 								currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
 							}
+							else if (rotationFC >= 225.0 && rotationFC < 315.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+							}
 							currItem->Sizing = false;
-							m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
 						}
 					}
 					currItem->update();
8860-PatchV2.diff (6,862 bytes)   

ale

2016-10-09 17:54

manager   ~0042111

seems to be correct!

FirasH

2016-10-09 18:19

reporter   ~0042114

As discussed with ale on IRC using, "To Frame Size" automatic scaling behaviour becomes unpredictable (even if logically correct) when resizing with Alt+Arrow.

Also noticed that even if the item is not specifically a Frame that contains some kind of image (e.g. resizing a Shape then converting to an Image Frame), that changes (x,y) default content position of the just converted Image Frame.

To avoid this, I added a bool value "moveImage" that allows moving content image only in certain cases (image is available and "To Frame Size" are true).

See 8860-PatchV3.diff
8860-PatchV3.diff (7,533 bytes)   

diff --git a/scribus/canvasmode.cpp b/scribus/canvasmode.cpp
--- a/scribus/canvasmode.cpp
+++ b/scribus/canvasmode.cpp
@@ -1295,6 +1295,7 @@
 			bool resizing=((buttonModifiers & Qt::AltModifier) && !(buttonModifiers & Qt::ControlModifier));
 			bool resizingsmaller=(resizing && (buttonModifiers & Qt::ShiftModifier));
 			double resizeBy=1.0;
+
 			//CB with control locked out due to the requirement of moveby of 0.01, we cannot support
 			//resizeby 10 units unless we move to supporting modifier keys that most people don't have.
 			//if (buttonModifiers & Qt::ControlModifier)
@@ -1304,6 +1305,17 @@
 				resizeBy*=-1.0;
 
 			PageItem *currItem = m_doc->m_Selection->itemAt(0);
+
+			//#8860
+			//rotationFC is a temporary variable to manage items rotation:
+			//currently an item with e.g. 40° rotation is as 360° - 40° = 320°
+			double rotationFC = fabs(360.0 - currItem->rotation());
+			double radRotation = rotationFC * M_PI / 180.0;
+
+			bool moveImage = false;
+			if ((currItem->asImageFrame() || currItem->asLatexFrame() || currItem->asOSGFrame()) && currItem->imageIsAvailable && !currItem->fitImageToFrame())
+				moveImage = true;
+
 			switch (kk)
 			{
 			case Qt::Key_Backspace:
@@ -1379,13 +1391,29 @@
 							m_view->TransformPoly(10, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else if (!currItem->sizeLocked())
 						{
-							if (!resizingsmaller)
+							if ((rotationFC > 0.0 && rotationFC < 45.0) || (rotationFC >= 315.0 && rotationFC <= 360.0))
 							{
-								m_doc->moveItem(-resizeBy, 0, currItem);
-								currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+								m_doc->moveItem(-resizeBy * cos(radRotation), resizeBy * sin(radRotation), currItem);
+								if (moveImage)
+									currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
 							}
+							else if (rotationFC >= 45.0 && rotationFC < 135.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+								m_doc->moveItem(-resizeBy * sin(radRotation), -resizeBy * cos(radRotation), currItem);
+								if (moveImage)
+									currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
+							}
+							else if (rotationFC >= 135.0 && rotationFC < 225.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+							}
+							else if (rotationFC >= 225.0 && rotationFC < 315.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+							}
 							currItem->Sizing = false;
-							m_doc->sizeItem(currItem->width()+resizeBy, currItem->height(), currItem);
 						}
 					}
 					currItem->update();
@@ -1453,13 +1481,29 @@
 							m_view->TransformPoly(11, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else if (!currItem->sizeLocked())
 						{
-							if (resizingsmaller)
+							if ((rotationFC > 0.0 && rotationFC < 45.0) || (rotationFC >= 315.0 && rotationFC <= 360.0))
 							{
-								m_doc->moveItem(-resizeBy, 0, currItem);
-								currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
 							}
+							else if (rotationFC >= 45.0 && rotationFC < 135.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+							}
+							else if (rotationFC >= 135.0 && rotationFC < 225.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+								m_doc->moveItem(-resizeBy * cos(radRotation), resizeBy * sin(radRotation), currItem);
+								if (moveImage)
+									currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
+							}
+							else if (rotationFC >= 225.0 && rotationFC < 315.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+								m_doc->moveItem(-resizeBy * sin(radRotation), -resizeBy * cos(radRotation), currItem);
+								if (moveImage)
+									currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
+							}
 							currItem->Sizing = false;
-							m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
 						}
 					}
 					currItem->update();
@@ -1527,13 +1571,29 @@
 							m_view->TransformPoly(12, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else
 						{
-							if (!resizingsmaller)
+							if ((rotationFC > 0.0 && rotationFC < 45.0) || (rotationFC >= 315.0 && rotationFC <= 360.0))
 							{
-								m_doc->moveItem(0, -resizeBy, currItem);
-								currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+								m_doc->moveItem(-resizeBy * sin(radRotation), -resizeBy * cos(radRotation), currItem);
+								if (moveImage)
+									currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
 							}
+							else if (rotationFC >= 45.0 && rotationFC < 135.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+							}
+							else if (rotationFC >= 135.0 && rotationFC < 225.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+							}
+							else if (rotationFC >= 225.0 && rotationFC < 315.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+								m_doc->moveItem(-resizeBy * cos(radRotation), resizeBy * sin(radRotation), currItem);
+								if (moveImage)
+									currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
+							}
 							currItem->Sizing = false;
-							m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
 						}
 					}
 					currItem->update();
@@ -1601,13 +1661,29 @@
 							m_view->TransformPoly(13, 0, resizeBy/unitGetRatioFromIndex(m_doc->unitIndex()));
 						else if (!currItem->sizeLocked())
 						{
-							if (resizingsmaller)
+							if ((rotationFC > 0.0 && rotationFC < 45.0) || (rotationFC >= 315.0 && rotationFC <= 360.0))
 							{
-								m_doc->moveItem(0, -resizeBy, currItem);
-								currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
 							}
+							else if (rotationFC >= 45.0 && rotationFC < 135.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+								m_doc->moveItem(-resizeBy * cos(radRotation), resizeBy * sin(radRotation), currItem);
+								if (moveImage)
+									currItem->moveImageXYOffsetBy(resizeBy / currItem->imageXScale(), 0);
+							}
+							else if (rotationFC >= 135.0 && rotationFC < 225.0)
+							{
+								m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
+								m_doc->moveItem(-resizeBy * sin(radRotation), -resizeBy * cos(radRotation), currItem);
+								if (moveImage)
+									currItem->moveImageXYOffsetBy(0, resizeBy / currItem->imageYScale());
+							}
+							else if (rotationFC >= 225.0 && rotationFC < 315.0)
+							{
+								m_doc->sizeItem(currItem->width() + resizeBy, currItem->height(), currItem);
+							}
 							currItem->Sizing = false;
-							m_doc->sizeItem(currItem->width(), currItem->height() + resizeBy, currItem);
 						}
 					}
 					currItem->update();
8860-PatchV3.diff (7,533 bytes)   

FirasH

2016-10-18 19:34

reporter   ~0042170

Thanks cbradney!
Fixed in 1.5.3.svn (21465).

Issue History

Date Modified Username Field Change
2010-02-20 19:06 ale New Issue
2014-07-20 21:54 FirasH Note Added: 0032843
2014-07-20 21:54 FirasH Status new => confirmed
2014-07-20 23:21 Kunda Target Version => 1.5.1
2015-09-01 12:50 FirasH Patch => No
2015-09-01 12:50 FirasH Summary using alt+arrow to resize a rotated frame leads to funny results => Resizing with Alt or Alt+Shift and arrows is wrong when rotation is applied to an Item
2015-11-09 06:07 Al-Hinai Tag Attached: HOST-Oman
2015-11-09 12:20 Mazoon Note Added: 0037343
2015-11-25 16:42 FirasH Relationship added related to 0013563
2016-01-23 17:17 cbradney Target Version 1.5.1 => 1.5.3
2016-01-23 21:13 Kunda Relationship added related to 0012118
2016-01-23 21:14 Kunda Relationship added related to 0003612
2016-04-05 13:14 Kunda Tag Attached: shortcuts
2016-04-05 13:33 Kunda Tag Attached: resize
2016-05-03 12:09 Kunda Tag Attached: rotate
2016-10-02 20:33 FirasH Note Added: 0042079
2016-10-06 19:01 FirasH File Added: 8860-Draft(1).diff
2016-10-07 13:50 FirasH File Added: 8860-Draft(2).diff
2016-10-07 23:15 FirasH File Added: 8860-Patch.diff
2016-10-07 23:15 FirasH Note Added: 0042105
2016-10-07 23:16 FirasH Patch No => Yes
2016-10-08 13:10 FirasH File Deleted: 8860-Patch.diff
2016-10-08 13:10 FirasH File Added: 8860-Patch.diff
2016-10-08 13:11 FirasH File Deleted: 8860-Draft(1).diff
2016-10-08 13:11 FirasH File Deleted: 8860-Draft(2).diff
2016-10-08 19:24 FirasH File Deleted: 8860-Patch.diff
2016-10-08 19:24 FirasH File Added: 8860-Patch.diff
2016-10-08 19:24 FirasH Note Added: 0042107
2016-10-08 19:27 FirasH File Deleted: 8860-Patch.diff
2016-10-08 19:28 FirasH File Added: 8860-Patch.diff
2016-10-08 20:34 FirasH File Deleted: 8860-Patch.diff
2016-10-08 20:35 FirasH File Added: 8860-Patch.diff
2016-10-09 11:41 FirasH File Added: 8860-PatchV2.diff
2016-10-09 11:41 FirasH Note Added: 0042109
2016-10-09 17:54 ale Note Added: 0042111
2016-10-09 18:19 FirasH File Added: 8860-PatchV3.diff
2016-10-09 18:19 FirasH Note Added: 0042114
2016-10-18 17:09 cbradney Tag Detached: HOST-Oman
2016-10-18 17:12 cbradney Assigned To => FirasH
2016-10-18 17:12 cbradney Status confirmed => resolved
2016-10-18 17:12 cbradney Resolution open => fixed
2016-10-18 17:12 cbradney Fixed in Version => 1.5.3.svn
2016-10-18 19:34 FirasH Status resolved => closed
2016-10-18 19:34 FirasH Note Added: 0042170