Shift keeps moved pixels on a line; Ctrl+A selects the canvas from the Layers panel (13.10)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-01 14:35:13 -04:00
1 parent 765e071c0c
commit 51e373af4c
6 files changed
+54 -32

No files matched your search

+9 -1
View File
@@ -85,7 +85,15 @@ bool CanvasView::moveSelectionTool(QPointF point, Qt::KeyboardModifiers modifier
{
if (m_pixelDragStart && m_session.document()) {
const QPointF pixel = m_session.viewport.documentPoint(point, m_session.document()->size());
m_session.movePixels(QSizeF(pixel.x() - m_pixelDragStart->x(), pixel.y() - m_pixelDragStart->y()));
QSizeF offset(pixel.x() - m_pixelDragStart->x(), pixel.y() - m_pixelDragStart->y());
// Shift keeps the pixels on a line, the longer way.
if (modifiers.testFlag(Qt::ShiftModifier)) {
if (std::abs(offset.width()) >= std::abs(offset.height()))
offset.setHeight(0);
else
offset.setWidth(0);
}
m_session.movePixels(offset);
updateCursor();
synchronizeDisplay();
return true;