View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017144 | Scribus | Graphics / Image Frames | public | 2024-01-27 09:15 | 2024-01-27 10:10 |
Reporter | ale | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | new | Resolution | open | ||
Product Version | 1.7.0.svn | ||||
Summary | 0017144: PATCH: ctrl: move image orthogonally inside of the image frame | ||||
Description | i still dream of 0015560 , but in the meantime we could have ctrl to force an orthogonal move inside of an image frame... | ||||
Tags | patch | ||||
Attached Files | 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}; | ||||
Patch | Yes | ||||