image-move-orthogonal.diff (1,868 bytes)
diff --git a/scribus/canvasmode_edit.cpp b/scribus/canvasmode_edit.cpp
index 0bba8be85..04a89ecad 100644
--- a/scribus/canvasmode_edit.cpp
+++ b/scribus/canvasmode_edit.cpp
@@ -445,6 +445,17 @@ void CanvasMode_Edit::mouseMoveEvent(QMouseEvent *m)
m_view->setCursor(IconManager::instance().loadCursor("handc.png"));
QTransform mm1 = currItem->getTransform();
QTransform mm2 = mm1.inverted();
+ if (m->modifiers() & Qt::ControlModifier)
+ {
+ //Dragging orthogonally - Ctrl Drag
+ int dX = qRound(newX - m_mousePressPoint.x()), dY = qRound(newY - m_mousePressPoint.y());
+ if (abs(dX) > abs(dY))
+ dY = 0;
+ else if (abs(dY) > abs(dX))
+ dX = 0;
+ newX = m_mousePressPoint.x() + dX;
+ newY = m_mousePressPoint.y() + dY;
+ }
QPointF rota = mm2.map(QPointF(newX, newY)) - mm2.map(QPointF(Mxp, Myp));
currItem->moveImageInFrame(rota.x() / currItem->imageXScale(), rota.y() / currItem->imageYScale());
m_canvas->displayXYHUD(m->globalPosition(), currItem->imageXOffset() * currItem->imageXScale(), currItem->imageYOffset() * currItem->imageYScale());
@@ -567,6 +578,7 @@ void CanvasMode_Edit::mousePressEvent(QMouseEvent *m)
m_canvas->m_viewMode.operItemMoving = false;
m_view->HaveSelRect = false;
m_doc->DragP = false;
+ m_mousePressPoint = mousePointDoc;
m_doc->leaveDrag = false;
m->accept();
m_view->registerMousePress(m->globalPosition());
diff --git a/scribus/canvasmode_edit.h b/scribus/canvasmode_edit.h
index a87677678..1ef6bc5fe 100644
--- a/scribus/canvasmode_edit.h
+++ b/scribus/canvasmode_edit.h
@@ -65,6 +65,8 @@ private:
bool SeleItem(QMouseEvent *m);
void createContextMenu(PageItem *currItem, double mx, double my);
+ FPoint m_mousePressPoint;
+
QElapsedTimer m_blinkTime;
QTimer* m_blinker;
ScribusMainWindow* m_ScMW {nullptr};