Skip to content

Commit 8714a88

Browse files
committed
fix previous commit
1 parent 947e5c6 commit 8714a88

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/ConnectionGraphicsObject.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,18 +247,20 @@ ConnectionStyle ConnectionGraphicsObject::connectionStyle() const
247247
//-------------------------------------------
248248
// This is a BehaviorTree specific code, not applicable to upstream
249249

250-
const auto& nodeStyle = StyleCollection::nodeStyle();
250+
const auto& defaultStyle = StyleCollection::nodeStyle();
251251

252252
auto inNodeStyle = _graphModel.nodeData(_connectionId.inNodeId, NodeRole::Style);
253253
QJsonDocument json = QJsonDocument::fromVariant(inNodeStyle);
254-
NodeStyle currentStyle(json.object());
254+
NodeStyle nodeStyle(json.object());
255255

256-
// if FilledConnectionPointColor was changed, use it as connection color
257-
if(nodeStyle.FilledConnectionPointColor != currentStyle.FilledConnectionPointColor)
256+
// In real-time monitoring mode, the color of the connection should be the same
257+
// as the NormalBoundaryColor.
258+
// We recognize this case by the fact that nodeStyle and defaultStyle are different
259+
if(defaultStyle.NormalBoundaryColor != nodeStyle.NormalBoundaryColor)
258260
{
259261
auto connectionJson = connectionStyle.toJson();
260262
auto connectionJsonObj = connectionJson["ConnectionStyle"].toObject();
261-
connectionJsonObj["NormalColor"] = nodeStyle.FilledConnectionPointColor.name();
263+
connectionJsonObj["NormalColor"] = nodeStyle.NormalBoundaryColor.name();
262264
connectionJson["ConnectionStyle"] = connectionJsonObj;
263265
connectionStyle.loadJson(connectionJson);
264266
}

0 commit comments

Comments
 (0)