Skip to content

Commit

Permalink
[ui] Update scene when node size changes to prevent background artefacts
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Oct 17, 2024
1 parent acaeb5a commit 7a90a87
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/plugins/score-lib-process/Process/Dataflow/NodeItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <score/command/Dispatchers/CommandDispatcher.hpp>
#include <score/document/DocumentContext.hpp>
#include <score/graphics/GraphicWidgets.hpp>
#include <score/graphics/GraphicsLayout.hpp>
#include <score/graphics/TextItem.hpp>
#include <score/model/Skin.hpp>
#include <score/selection/SelectionDispatcher.hpp>
Expand All @@ -26,6 +27,7 @@
#include <ossia-qt/invoke.hpp>

#include <QCursor>
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
#include <QKeyEvent>
#include <QPainter>
Expand Down Expand Up @@ -416,8 +418,11 @@ double NodeItem::minimalContentHeight() const noexcept
void NodeItem::updateSize()
{
if(!m_label)
{
if(auto sc = this->scene())
sc->update();
return;

}
auto sz = m_fx ? m_fx->boundingRect().size()
: QSizeF{minimalContentWidth(), minimalContentHeight()};

Expand Down Expand Up @@ -447,6 +452,8 @@ void NodeItem::updateSize()
}
updateTitlePos();
update();
if(auto sc = this->scene())
sc->update();
}
}

Expand Down Expand Up @@ -477,6 +484,8 @@ void NodeItem::setSize(QSizeF sz)
m_uiButton->setPos({m_contentSize.width() + TopButtonX0, TopButtonY0});
}
}
if(auto sc = this->scene())
sc->update();
}

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

0 comments on commit 7a90a87

Please sign in to comment.