Element editor : minor improvement

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4061 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-07-21 12:29:43 +00:00
parent 012ba2ccd7
commit 50c61b4e03
13 changed files with 126 additions and 1 deletions

View File

@@ -306,6 +306,25 @@ QPainterPath PartPolygon::shape() const
QPainterPath shape;
shape.addPolygon(m_polygon);
if (m_closed)
shape.lineTo(m_polygon.first());
QPainterPathStroker pps;
pps.setWidth(penWeight());
shape = pps.createStroke(shape);
if (isSelected())
foreach(QRectF rect, m_handler.handlerRect(m_polygon))
shape.addRect(rect);
return shape;
}
QPainterPath PartPolygon::shadowShape() const
{
QPainterPath shape;
shape.addPolygon(m_polygon);
if (m_closed)
shape.lineTo(m_polygon.first());
@@ -329,5 +348,9 @@ QRectF PartPolygon::boundingRect() const
if (penWeight() == 0) adjust += 0.5;
r.adjust(-adjust, -adjust, adjust, adjust);
foreach(QRectF rect, m_handler.handlerRect(m_polygon))
r |=rect;
return(r);
}