View Issue Details

IDProjectCategoryView StatusLast Update
0015563ScribusCanvaspublic2019-06-04 20:55
ReporterGibbz Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.5.4 
Fixed in Version1.5.5.svn 
Summary0015563: Add shift modifier to resize gesture
DescriptionIve put together a patch that allows a user to use the shift key to set the pivot to the center of the object while resizing with the mouse.
It can also be used in combination with the ctrl key to constrain proportions.
Steps To ReproduceAdd an object to the document.
select a resize handle
press shift while resizing will resize around the center of the object with this patch
TagsNo tags attached.
PatchYes

Activities

Gibbz

2019-02-01 02:42

reporter  

resize_shift.patch (1,845 bytes)   
diff --git a/scribus/canvasgesture_resize.cpp b/scribus/canvasgesture_resize.cpp
index 35b940627..f8005e2ac 100644
--- a/scribus/canvasgesture_resize.cpp
+++ b/scribus/canvasgesture_resize.cpp
@@ -468,8 +468,13 @@ void ResizeGesture::adjustBounds(QMouseEvent *m)
 	QTransform rotation;
 	FPoint docPoint = m_canvas->globalToCanvas(m->globalPos());
 	QPointF oldXY = m_bounds.topLeft();
+
 	// proportional resize
 	bool constrainRatio = ((m->modifiers() & Qt::ControlModifier) != Qt::NoModifier);
+
+	// center resize pivot
+	bool center_pivot = ((m->modifiers() & Qt::ShiftModifier) != Qt::NoModifier);
+
 /*
 	if (m_mousePressPoint == m->globalPos())
 	{
@@ -628,6 +633,41 @@ void ResizeGesture::adjustBounds(QMouseEvent *m)
 //		qDebug() << "constrained:" << m_bounds << double(m_bounds.width()) / m_bounds.height();
 	}
 
+	// shif key modifier
+	// move around around the pivot
+	if (center_pivot){
+		m_bounds.moveCenter(m_origBounds.center());
+	}
+	else {
+		// reset to original position if user releases shift button during resize
+		switch (m_handle)
+		{
+			case Canvas::NORTHWEST:
+				m_bounds.moveBottomRight(m_origBounds.bottomRight());
+				break;
+			case Canvas::WEST:
+				m_bounds.moveRight(m_origBounds.right());
+				break;
+			case Canvas::SOUTHWEST:
+				m_bounds.moveTopRight(m_origBounds.topRight());
+				break;
+			case Canvas::SOUTH:
+				m_bounds.moveTop(m_origBounds.top());
+				break;
+			case Canvas::NORTHEAST:
+				m_bounds.moveBottomLeft(m_origBounds.bottomLeft());
+				break;
+			case Canvas::EAST:
+				m_bounds.moveLeft(m_origBounds.left());
+				break;
+			case Canvas::SOUTHEAST:
+				m_bounds.moveTopLeft(m_origBounds.topLeft());
+				break;
+			default:
+				break;
+		}
+	}
+
 	// re-rotate: if top left has changed, then it needs rotation
 	if (m_rotation != 0 && oldXY != m_bounds.topLeft())
 	{
resize_shift.patch (1,845 bytes)   

ale

2019-02-01 08:21

manager   ~0045873

i've already wished in the past to be able to scale from the center.
but that was always for vector drawing tasks.

on the one side it's a nice improvement, that can be useful in corner cases
on the other side, i would like to keep the shift key free for enabling / disabling the snapping (to items)... something that would have more value to me.

could there be a different way to change the reference point for the resizing?

Gibbz

2019-02-01 23:32

reporter   ~0045876

Ha, yes I guess my work is a corner case :) I do a lot of image heavy advertising/catalogues, so having that shortcut quickly accessible is a big time saver.
Could change the key to alt, but i'm just following the standard of most common software as that what my muscle memory defaults to.
I guess a clumsy alternate would be to use the properties panel anchor point as the default scale point...But then the user would not be able to change it on the fly.

What about using another key for snap? Caps lock (a toggle) or tab key, or S key? Or can we determine right ctl, right alt or right shift for extra modifiers in QT? I did post on the forums some suggestions for snap http://forums.scribus.net/index.php/topic,3191.0.html

jghali

2019-02-03 01:37

administrator   ~0045882

>> on the other side, i would like to keep the shift key free for enabling / disabling the snapping (to items).

By using Preferences > Keyboard Shortcut, you can already define a shortcut to enable/disable any of the snapping actions from Page menu... So this shift key for enabling / disabling snapping seems to me a duplicate of already existing functionality.

ale

2019-04-16 13:02

manager   ~0046130

@jghali, not really... my proposal it's about adding the shift key in the same way as one can use ctrl to force the movement along the axis.

of course, i could set a shortcut for the item movement, but it's not the same "user experience" by far.

Issue History

Date Modified Username Field Change
2019-02-01 02:42 Gibbz New Issue
2019-02-01 02:42 Gibbz File Added: resize_shift.patch
2019-02-01 08:21 ale Note Added: 0045873
2019-02-01 23:32 Gibbz Note Added: 0045876
2019-02-03 01:37 jghali Note Added: 0045882
2019-02-03 23:56 jghali Summary [patch] Add shift modifier to resize gesture => Add shift modifier to resize gesture
2019-02-03 23:57 jghali Assigned To => jghali
2019-02-03 23:57 jghali Status new => resolved
2019-02-03 23:57 jghali Resolution open => fixed
2019-02-03 23:57 jghali Fixed in Version => 1.5.5.svn
2019-04-16 13:02 ale Note Added: 0046130
2019-06-04 20:55 cbradney Status resolved => closed