diff options
Diffstat (limited to 'Swift/QtUI/Whiteboard/FreehandLineItem.cpp')
-rw-r--r-- | Swift/QtUI/Whiteboard/FreehandLineItem.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Swift/QtUI/Whiteboard/FreehandLineItem.cpp b/Swift/QtUI/Whiteboard/FreehandLineItem.cpp index 9beb47b..8821062 100644 --- a/Swift/QtUI/Whiteboard/FreehandLineItem.cpp +++ b/Swift/QtUI/Whiteboard/FreehandLineItem.cpp @@ -32,18 +32,15 @@ namespace Swift { void FreehandLineItem::setStartPoint(QPointF point) { - prepareGeometryChange(); points_.clear(); points_.append(point); QRectF rect(point, point); + prepareGeometryChange(); boundRect = rect; - update(rect); } void FreehandLineItem::lineTo(QPointF point) { - prepareGeometryChange(); - qreal x1, x2, y1, y2; x1 = points_.last().x(); x2 = point.x(); @@ -63,8 +60,8 @@ namespace Swift { points_.append(point); + prepareGeometryChange(); boundRect |= rect; - update(rect); } bool FreehandLineItem::collidesWithPath(const QPainterPath& path, Qt::ItemSelectionMode /*mode*/) const @@ -82,6 +79,7 @@ namespace Swift { void FreehandLineItem::setPen(const QPen& pen) { pen_ = pen; + update(boundRect); } QPen FreehandLineItem::pen() const |