mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user