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(); prepareGeometryChange();
} }
//---------------------------------------------------------------------------------------------------------------------
double VGrainlineItem::GetAngle(const QPointF &pt) const
{
return -VPieceItem::GetAngle(pt);
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
* @brief VGrainlineItem::Rotate rotates point pt around ptCenter by angle dAng [rad] * @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; virtual void Update() Q_DECL_OVERRIDE;
void UpdateRectangle(); void UpdateRectangle();
virtual double GetAngle(const QPointF &pt) const Q_DECL_OVERRIDE;
QPointF Rotate(const QPointF& pt, const QPointF& ptCenter, qreal dAng) const; QPointF Rotate(const QPointF& pt, const QPointF& ptCenter, qreal dAng) const;
QPointF GetInsideCorner(int i, qreal dDist) const; QPointF GetInsideCorner(int i, qreal dDist) const;

View File

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

View File

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