Skip to content

Commit 7a90a87

Browse files
committed
[ui] Update scene when node size changes to prevent background artefacts
1 parent acaeb5a commit 7a90a87

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/plugins/score-lib-process/Process/Dataflow/NodeItem.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <score/command/Dispatchers/CommandDispatcher.hpp>
1818
#include <score/document/DocumentContext.hpp>
1919
#include <score/graphics/GraphicWidgets.hpp>
20+
#include <score/graphics/GraphicsLayout.hpp>
2021
#include <score/graphics/TextItem.hpp>
2122
#include <score/model/Skin.hpp>
2223
#include <score/selection/SelectionDispatcher.hpp>
@@ -26,6 +27,7 @@
2627
#include <ossia-qt/invoke.hpp>
2728

2829
#include <QCursor>
30+
#include <QGraphicsScene>
2931
#include <QGraphicsSceneMouseEvent>
3032
#include <QKeyEvent>
3133
#include <QPainter>
@@ -416,8 +418,11 @@ double NodeItem::minimalContentHeight() const noexcept
416418
void NodeItem::updateSize()
417419
{
418420
if(!m_label)
421+
{
422+
if(auto sc = this->scene())
423+
sc->update();
419424
return;
420-
425+
}
421426
auto sz = m_fx ? m_fx->boundingRect().size()
422427
: QSizeF{minimalContentWidth(), minimalContentHeight()};
423428

@@ -447,6 +452,8 @@ void NodeItem::updateSize()
447452
}
448453
updateTitlePos();
449454
update();
455+
if(auto sc = this->scene())
456+
sc->update();
450457
}
451458
}
452459

@@ -477,6 +484,8 @@ void NodeItem::setSize(QSizeF sz)
477484
m_uiButton->setPos({m_contentSize.width() + TopButtonX0, TopButtonY0});
478485
}
479486
}
487+
if(auto sc = this->scene())
488+
sc->update();
480489
}
481490

482491
const Id<Process::ProcessModel>& NodeItem::id() const noexcept

0 commit comments

Comments
 (0)