Merge branch 'master' into cache-update
This commit is contained in:
@@ -779,10 +779,6 @@ void NodeView::ShowContextMenu(const QPoint &pos)
|
||||
|
||||
if (itemAt(pos) && !selected.isEmpty()) {
|
||||
|
||||
// Label node action
|
||||
QAction* label_action = m.addAction(tr("Label"));
|
||||
connect(label_action, &QAction::triggered, this, &NodeView::LabelSelectedNodes);
|
||||
|
||||
// Grouping
|
||||
if (selected.size() == 1 && dynamic_cast<NodeGroup*>(selected.first()->GetNode())) {
|
||||
QAction *ungroup_action = m.addAction(tr("Ungroup"));
|
||||
@@ -818,10 +814,6 @@ void NodeView::ShowContextMenu(const QPoint &pos)
|
||||
|
||||
m.addSeparator();
|
||||
|
||||
AddSetScrollZoomsByDefaultActionToMenu(&m);
|
||||
|
||||
m.addSeparator();
|
||||
|
||||
Menu* direction_menu = new Menu(tr("Direction"), &m);
|
||||
m.addMenu(direction_menu);
|
||||
|
||||
|
||||
@@ -112,6 +112,8 @@ public slots:
|
||||
|
||||
void CenterOnNode(olive::Node *n);
|
||||
|
||||
void LabelSelectedNodes();
|
||||
|
||||
signals:
|
||||
void NodesSelected(const QVector<Node*>& nodes);
|
||||
|
||||
@@ -275,8 +277,6 @@ private slots:
|
||||
|
||||
void ShowNodeProperties();
|
||||
|
||||
void LabelSelectedNodes();
|
||||
|
||||
void ItemAboutToBeDeleted(NodeViewItem *item);
|
||||
|
||||
void CloseOverlay();
|
||||
|
||||
@@ -372,7 +372,7 @@ void NodeViewItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
|
||||
if (element_ == -1) {
|
||||
node_name = node_->GetInputName(input_);
|
||||
} else {
|
||||
node_name = QString::number(element_);
|
||||
node_name = QString::number(element_ + node_->GetInputProperty(input_, QStringLiteral("arraystart")).toInt());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,7 +580,7 @@ QPointF NodeViewItem::GetInputPoint() const
|
||||
QPointF NodeViewItem::GetOutputPoint() const
|
||||
{
|
||||
QPointF p = output_connector_->scenePos();
|
||||
QRectF r = output_connector_->boundingRect();
|
||||
QRectF r = output_connector_->polygon().boundingRect();
|
||||
|
||||
switch (flow_dir_) {
|
||||
case NodeViewCommon::kLeftToRight:
|
||||
@@ -627,7 +627,7 @@ void NodeViewItem::UpdateNodePosition()
|
||||
|
||||
void NodeViewItem::UpdateInputConnectorPosition()
|
||||
{
|
||||
QRectF output_rect = input_connector_->boundingRect();
|
||||
QRectF output_rect = input_connector_->polygon().boundingRect();
|
||||
|
||||
NodeViewCommon::FlowDirection using_flow_dir = flow_dir_;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,6 +39,9 @@ public:
|
||||
return output_;
|
||||
}
|
||||
|
||||
virtual QPainterPath shape() const override;
|
||||
virtual QRectF boundingRect() const override;
|
||||
|
||||
private:
|
||||
bool output_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user