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

@@ -272,6 +272,31 @@ QPainterPath PartLine::shape() const
shape.lineTo(m_line.p2());
}
QPainterPathStroker pps;
pps.setWidth(penWeight());
shape = pps.createStroke(shape);
if (isSelected())
foreach(QRectF rect, m_handler.handlerRect(m_handler.pointsForLine(m_line)))
shape.addRect(rect);
return shape;
}
QPainterPath PartLine::shadowShape() const
{
QPainterPath shape;
//We calcul path only if there is an end type
//Else we just draw a line
if (first_end || second_end)
shape.addPath(path());
else
{
shape.moveTo(m_line.p1());
shape.lineTo(m_line.p2());
}
QPainterPathStroker pps;
pps.setWidth(penWeight());
@@ -409,6 +434,10 @@ QRectF PartLine::boundingRect() const
bound = bound.normalized();
bound.adjust(-adjust, -adjust, adjust, adjust);
foreach(QRectF rect, m_handler.handlerRect(m_handler.pointsForLine(m_line)))
bound |= rect;
return bound;
}