QPainterPath LineItem::rightMidGrip() const { QRectF bound = gripBoundingRect(); QRectF grip = QRectF(bound.topRight() - QPointF(sizeOfGrip().width(), 0), sizeOfGrip()); grip.moveCenter(QPointF(grip.center().x(), bound.center().y())); QPainterPath path; path.addEllipse(grip); return path; }
QPainterPath LineItem::rightMidGrip() const { if (gripMode() == Move) return QPainterPath(); QRectF bound = gripBoundingRect(); QRectF grip = QRectF(bound.topRight() - QPointF(sizeOfGrip().width(), 0), sizeOfGrip()); grip.moveCenter(QPointF(grip.center().x(), bound.center().y())); QPainterPath path; if (gripMode() == Resize || gripMode() == Scale) path.addRect(grip); else path.addEllipse(grip); return path; }