nodeview: better implementation of larger connector hitboxes
This commit is contained in:
@@ -81,4 +81,19 @@ void NodeViewItemConnector::SetFlowDirection(NodeViewCommon::FlowDirection dir)
|
||||
setPolygon(p);
|
||||
}
|
||||
|
||||
QPainterPath NodeViewItemConnector::shape() const
|
||||
{
|
||||
// Yes, we skip QGraphicsPolygonItem because it adds the polygon. QGraphicsItem adds the
|
||||
// boundingRect which we modify below
|
||||
return QGraphicsItem::shape(); // clazy:exclude=skipped-base-method
|
||||
}
|
||||
|
||||
QRectF NodeViewItemConnector::boundingRect() const
|
||||
{
|
||||
QRectF b = this->polygon().boundingRect();
|
||||
const int radius = QFontMetrics(QFont()).height()/2;
|
||||
b.adjust(-radius, -radius, radius, radius);
|
||||
return b;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user