mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-05 20:20:52 +01:00
Probably fix the fucking crash of ghost conductor.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4752 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -246,22 +246,26 @@ QPainterPath QetShapeItem::shape() const
|
||||
pps.setJoinStyle(Qt::RoundJoin);
|
||||
path = pps.createStroke(path);
|
||||
|
||||
if (isSelected())
|
||||
{
|
||||
QVector <QPointF> vector;
|
||||
/**
|
||||
Code below is commented to avoid weird bug see : QPainterPath Conductor::shape() const
|
||||
for more information
|
||||
**/
|
||||
// if (isSelected())
|
||||
// {
|
||||
// QVector <QPointF> vector;
|
||||
|
||||
if (m_shapeType == Line)
|
||||
vector << m_P1 << m_P2;
|
||||
else if (m_shapeType == Rectangle || m_shapeType == Ellipse) {
|
||||
QRectF rect (m_P1, m_P2);
|
||||
vector << rect.topLeft() << rect.topRight() << rect.bottomRight() << rect.bottomLeft();
|
||||
}
|
||||
else
|
||||
vector = m_polygon;
|
||||
// if (m_shapeType == Line)
|
||||
// vector << m_P1 << m_P2;
|
||||
// else if (m_shapeType == Rectangle || m_shapeType == Ellipse) {
|
||||
// QRectF rect (m_P1, m_P2);
|
||||
// vector << rect.topLeft() << rect.topRight() << rect.bottomRight() << rect.bottomLeft();
|
||||
// }
|
||||
// else
|
||||
// vector = m_polygon;
|
||||
|
||||
foreach(QRectF r, m_handler.handlerRect(vector))
|
||||
path.addRect(r);
|
||||
}
|
||||
// foreach(QRectF r, m_handler.handlerRect(vector))
|
||||
// path.addRect(r);
|
||||
// }
|
||||
|
||||
return (path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user