Fix issue with angle direction of grainline.
--HG-- branch : feature
This commit is contained in:
parent
011f0eaec0
commit
de6e3d7213
|
@ -756,7 +756,7 @@ void VToolSeamAllowance::SaveRotationPattern(qreal dRot)
|
|||
// Tranform angle to anticlockwise
|
||||
QLineF line(0, 0, 100, 0);
|
||||
line.setAngle(-dRot);
|
||||
newDet.GetPatternInfo().SetRotation(QString().setNum(dRot));
|
||||
newDet.GetPatternInfo().SetRotation(QString().setNum(line.angle()));
|
||||
|
||||
SavePieceOptions* rotateCommand = new SavePieceOptions(oldDet, newDet, doc, id);
|
||||
rotateCommand->setText(tr("rotate pattern info label"));
|
||||
|
|
|
@ -666,19 +666,6 @@ QLineF VGrainlineItem::MainLine() const
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPolygonF VGrainlineItem::FirstArrow(qreal dArrLen) const
|
||||
{
|
||||
const QPointF pt1 = MainLine().p1();
|
||||
QPolygonF poly;
|
||||
poly << pt1;
|
||||
poly << QPointF(pt1.x() + dArrLen*cos(m_dRotation + ARROW_ANGLE),
|
||||
pt1.y() - dArrLen*sin(m_dRotation + ARROW_ANGLE));
|
||||
poly << QPointF(pt1.x() + dArrLen*cos(m_dRotation - ARROW_ANGLE),
|
||||
pt1.y() - dArrLen*sin(m_dRotation - ARROW_ANGLE));
|
||||
return poly;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPolygonF VGrainlineItem::SecondArrow(qreal dArrLen) const
|
||||
{
|
||||
const QPointF pt2 = MainLine().p2();
|
||||
QPolygonF poly;
|
||||
|
@ -690,6 +677,19 @@ QPolygonF VGrainlineItem::SecondArrow(qreal dArrLen) const
|
|||
return poly;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPolygonF VGrainlineItem::SecondArrow(qreal dArrLen) const
|
||||
{
|
||||
const QPointF pt1 = MainLine().p1();
|
||||
QPolygonF poly;
|
||||
poly << pt1;
|
||||
poly << QPointF(pt1.x() + dArrLen*cos(m_dRotation + ARROW_ANGLE),
|
||||
pt1.y() - dArrLen*sin(m_dRotation + ARROW_ANGLE));
|
||||
poly << QPointF(pt1.x() + dArrLen*cos(m_dRotation - ARROW_ANGLE),
|
||||
pt1.y() - dArrLen*sin(m_dRotation - ARROW_ANGLE));
|
||||
return poly;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPainterPath VGrainlineItem::MainShape() const
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user