mirror of
https://gitlab.com/smart-pattern/valentina.git
synced 2024-09-18 23:04:03 +02:00
Puzzle app. Piece rotation with step 15 degrees by holding Ctrl key.
This commit is contained in:
parent
d3d550ce70
commit
dc7f0fc74f
|
@ -8,6 +8,7 @@
|
|||
- Fix parsing SVG fonts.
|
||||
- Add "Twin Sans" single stroke font.
|
||||
- Fixed generation of mirror side of piece based on fold line.
|
||||
- Puzzle app. Piece rotation with step 15 degrees by holding Ctrl key.
|
||||
|
||||
# Valentina 0.7.53 June 25, 2024
|
||||
- Fix layout sheet export with empty name.
|
||||
|
|
|
@ -409,6 +409,7 @@ void VPGraphicsPieceControls::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick)
|
||||
{
|
||||
m_rotationStartPoint = event->scenePos();
|
||||
m_rotationSum = 0;
|
||||
m_controlsVisible = false;
|
||||
m_handleCorner = SelectedHandleCorner(event->pos());
|
||||
m_ignorePieceTransformation = true;
|
||||
|
@ -453,6 +454,16 @@ void VPGraphicsPieceControls::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
|||
rotateOn = rotateOn - 360.;
|
||||
}
|
||||
|
||||
m_rotationSum += rotateOn;
|
||||
|
||||
if (event->modifiers() & Qt::ControlModifier)
|
||||
{
|
||||
const qreal sign = std::copysign(1.0, m_rotationSum);
|
||||
const int steps = qFloor(qAbs(m_rotationSum / 15));
|
||||
rotateOn = 15 * steps * sign;
|
||||
m_rotationSum -= rotateOn;
|
||||
}
|
||||
|
||||
if (not qFuzzyIsNull(rotateOn))
|
||||
{
|
||||
if (VPLayoutPtr const layout = m_layout.toStrongRef(); not layout.isNull())
|
||||
|
|
|
@ -151,6 +151,7 @@ private:
|
|||
bool allowChangeMerge{false};
|
||||
QList<VPPiecePtr> m_selectedPieces{};
|
||||
bool m_ignorePieceTransformation{false};
|
||||
qreal m_rotationSum{0};
|
||||
|
||||
QMap<VPHandleCornerType, QPixmap> m_handlePixmaps{};
|
||||
QMap<VPHandleCornerType, QPixmap> m_handleHoverPixmaps{};
|
||||
|
|
Loading…
Reference in a new issue