22
33#include < QtCore/QMargins>
44
5+ #include " NodeGraphicsObject.hpp"
56#include " NodeGeometry.hpp"
67#include " NodeState.hpp"
78#include " NodeDataModel.hpp"
@@ -16,11 +17,13 @@ paint(QPainter* painter,
1617
1718 NodeState const & state = node->nodeState ();
1819
20+ std::unique_ptr<NodeGraphicsObject> const & graphicsObject = node->nodeGraphicsObject ();
21+
1922 geom.recalculateSize (painter->fontMetrics ());
2023
2124 // --------------------------------------------
2225
23- drawNodeRect (painter, geom);
26+ drawNodeRect (painter, geom, graphicsObject );
2427
2528 drawConnectionPoints (painter, geom, state);
2629
@@ -39,16 +42,19 @@ paint(QPainter* painter,
3942void
4043NodePainter::
4144drawNodeRect (QPainter* painter,
42- NodeGeometry const & geom)
45+ NodeGeometry const & geom,
46+ std::unique_ptr<NodeGraphicsObject> const & graphicsObject)
4347{
48+ auto color = graphicsObject->isSelected () ? QColor (255 , 150 , 0 ) : Qt::white;
49+
4450 if (geom.hovered ())
4551 {
46- QPen p (Qt::white , 2.0 );
52+ QPen p (color , 2.0 );
4753 painter->setPen (p);
4854 }
4955 else
5056 {
51- QPen p (Qt::white , 1.5 );
57+ QPen p (color , 1.5 );
5258 painter->setPen (p);
5359 }
5460
0 commit comments