take into account Show Seamline

This commit is contained in:
Ronan Le Tiec 2020-11-10 21:29:23 +01:00
parent 6d2b05ccc4
commit f448514c71
2 changed files with 16 additions and 1 deletions

View File

@ -109,6 +109,7 @@ void VPGraphicsPiece::Init()
connect(m_piece, &VPPiece::SelectionChanged, this, &VPGraphicsPiece::on_PieceSelectionChanged);
connect(m_piece, &VPPiece::PositionChanged, this, &VPGraphicsPiece::on_PiecePositionChanged);
connect(m_piece, &VPPiece::RotationChanged, this, &VPGraphicsPiece::on_PieceRotationChanged);
connect(m_piece, &VPPiece::PropertiesChanged, this, &VPGraphicsPiece::on_PiecePropertiesChanged);
}
//---------------------------------------------------------------------------------------------------------------------
@ -168,7 +169,7 @@ void VPGraphicsPiece::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
}
// paint the seam line
if(!m_seamLine.isEmpty())
if(!m_seamLine.isEmpty() && m_piece->GetShowSeamLine())
{
painter->drawPath(m_seamLine);
}
@ -370,6 +371,15 @@ void VPGraphicsPiece::on_PieceRotationChanged()
setRotation(-m_piece->GetRotation());
}
//---------------------------------------------------------------------------------------------------------------------
void VPGraphicsPiece::on_PiecePropertiesChanged()
{
if(scene())
{
scene()->update();
}
}
//---------------------------------------------------------------------------------------------------------------------
QVariant VPGraphicsPiece::itemChange(GraphicsItemChange change, const QVariant &value)
{

View File

@ -63,6 +63,11 @@ public slots:
*/
void on_PieceRotationChanged();
/**
* @brief on_PiecePropertiesChanged Slot called when the showSeamline / mirrored was changed
*/
void on_PiecePropertiesChanged();
protected:
QRectF boundingRect() const override;
QPainterPath shape() const override;