Fix label rotation.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-03-01 07:38:43 +02:00
parent e3fdad1321
commit 0a94c5036b
4 changed files with 11 additions and 3 deletions

View File

@ -541,6 +541,12 @@ void VGrainlineItem::UpdateRectangle()
prepareGeometryChange();
}
//---------------------------------------------------------------------------------------------------------------------
double VGrainlineItem::GetAngle(const QPointF &pt) const
{
return -VPieceItem::GetAngle(pt);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief VGrainlineItem::Rotate rotates point pt around ptCenter by angle dAng [rad]

View File

@ -59,6 +59,8 @@ protected:
virtual void Update() Q_DECL_OVERRIDE;
void UpdateRectangle();
virtual double GetAngle(const QPointF &pt) const Q_DECL_OVERRIDE;
QPointF Rotate(const QPointF& pt, const QPointF& ptCenter, qreal dAng) const;
QPointF GetInsideCorner(int i, qreal dDist) const;

View File

@ -103,7 +103,7 @@ double VPieceItem::GetAngle(const QPointF &pt) const
}
else
{
return -qAtan2(dY, dX);
return qAtan2(dY, dX);
}
}

View File

@ -48,8 +48,6 @@ public:
void Reset();
bool IsIdle() const;
double GetAngle(const QPointF &pt) const;
MoveType GetMoveType() const;
void SetMoveType(const MoveType &moveType);
@ -72,6 +70,8 @@ protected:
qreal m_inactiveZ;
virtual double GetAngle(const QPointF &pt) const;
private:
Q_DISABLE_COPY(VPieceItem)
};