Fix grainline's resize rectangle position.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-03-14 11:56:41 +02:00
parent 2eac3e0643
commit 76748f7688

View file

@ -564,20 +564,20 @@ void VGrainlineItem::UpdateRectangle()
setTransformOriginPoint(m_rectBoundingBox.center());
m_polyResize.clear();
QPointF ptA = m_polyBound.at(3);
QPointF ptA = m_polyBound.at(1);
m_polyResize << ptA;
const double dSize = m_dScale * RESIZE_RECT_SIZE;
ptA.setX(ptA.x() + dSize*cos(m_dRotation - M_PI/2));
ptA.setY(ptA.y() - dSize*sin(m_dRotation - M_PI/2));
ptA.setX(ptA.x() - dSize*cos(m_dRotation - M_PI/2));
ptA.setY(ptA.y() + dSize*sin(m_dRotation - M_PI/2));
m_polyResize << ptA;
ptA.setX(ptA.x() - dSize*cos(m_dRotation));
ptA.setY(ptA.y() + dSize*sin(m_dRotation));
ptA.setX(ptA.x() + dSize*cos(m_dRotation));
ptA.setY(ptA.y() - dSize*sin(m_dRotation));
m_polyResize << ptA;
ptA.setX(ptA.x() + dSize*cos(m_dRotation + M_PI/2));
ptA.setY(ptA.y() - dSize*sin(m_dRotation + M_PI/2));
ptA.setX(ptA.x() - dSize*cos(m_dRotation + M_PI/2));
ptA.setY(ptA.y() + dSize*sin(m_dRotation + M_PI/2));
m_polyResize << ptA;
prepareGeometryChange();