Fix issue with angle direction of grainline.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-03-14 11:11:35 +02:00
parent 011f0eaec0
commit de6e3d7213
2 changed files with 14 additions and 14 deletions

View File

@ -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"));

View File

@ -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
{