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

@@ -122,6 +122,16 @@ void PartArc::fromXml(const QDomElement &qde) {
m_span_angle = qde.attribute("angle", "-1440").toInt() * 16;
}
QRectF PartArc::boundingRect() const
{
QRectF r = AbstractPartEllipse::boundingRect();
foreach(QRectF rect, m_handler.handlerRect(m_handler.pointsForRect(m_rect)))
r |= rect;
return r;
}
/**
* @brief PartArc::shape
* @return the shape of this item
@@ -143,6 +153,18 @@ QPainterPath PartArc::shape() const
return shape;
}
QPainterPath PartArc::shadowShape() const
{
QPainterPath shape;
shape.arcMoveTo(m_rect, m_start_angle/16);
shape.arcTo(m_rect, m_start_angle/16, m_span_angle/16);
QPainterPathStroker pps;
pps.setWidth(penWeight());
return (pps.createStroke(shape));
}
/**
* @brief PartArc::mousePressEvent
* Handle mouse press event