Skip to content

Commit 89c9ba6

Browse files
committed
Improved code style consistency.
1 parent 95274f1 commit 89c9ba6

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

SubSystems/VisualNodeArea/VisualNodeArea.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ void NodeArea::PropagateNodeEventsCallbacks(Node* Node, const NODE_EVENT EventTo
124124

125125
void NodeArea::SaveToFile(const char* FileName) const
126126
{
127-
const std::string json_file = ToJson();
127+
const std::string JsonFile = ToJson();
128128
std::ofstream SaveFile;
129129
SaveFile.open(FileName);
130-
SaveFile << json_file;
130+
SaveFile << JsonFile;
131131
SaveFile.close();
132132
}
133133

@@ -137,10 +137,10 @@ void NodeArea::SaveNodesToFile(const char* FileName, std::vector<Node*> Nodes)
137137
return;
138138

139139
const NodeArea* NewNodeArea = NodeArea::CreateNodeArea(Nodes, std::vector<GroupComment*>());
140-
const std::string json_file = NewNodeArea->ToJson();
140+
const std::string JsonFile = NewNodeArea->ToJson();
141141
std::ofstream SaveFile;
142142
SaveFile.open(FileName);
143-
SaveFile << json_file;
143+
SaveFile << JsonFile;
144144
SaveFile.close();
145145
delete NewNodeArea;
146146
}
@@ -170,7 +170,7 @@ void NodeArea::ProcessConnections(const std::vector<NodeSocket*>& Sockets,
170170
{
171171
if (Node::IsNodeWithIDInList(ConnectedSocket->GetParent()->GetID(), SourceNodes))
172172
{
173-
// Check maybe we already establish this connection.
173+
// Check if we have already established this connection.
174174
if (!IsAlreadyConnected(OldToNewSocket[CurrentSocket], OldToNewSocket[ConnectedSocket], TargetArea->Connections))
175175
{
176176
std::unordered_map<RerouteNode*, RerouteNode*> OldToNewRerouteNode;
@@ -269,37 +269,37 @@ NodeArea* NodeArea::CreateNodeArea(const std::vector<Node*> Nodes, const std::ve
269269

270270
std::string NodeArea::ToJson() const
271271
{
272-
Json::Value root;
272+
Json::Value Root;
273273
std::ofstream SaveFile;
274274

275275
Json::Value NodesData;
276276
for (size_t i = 0; i < Nodes.size(); i++)
277277
{
278278
NodesData[std::to_string(i)] = Nodes[i]->ToJson();
279279
}
280-
root["nodes"] = NodesData;
280+
Root["nodes"] = NodesData;
281281

282282
Json::Value ConnectionsData;
283283
for (size_t i = 0; i < Connections.size(); i++)
284284
{
285285
ConnectionsData[std::to_string(i)]["in"]["socket_ID"] = Connections[i]->In->GetID();
286-
size_t socket_index = 0;
286+
size_t SocketIndex = 0;
287287
for (size_t j = 0; j < Connections[i]->In->GetParent()->Input.size(); j++)
288288
{
289289
if (Connections[i]->In->GetParent()->Input[j]->GetID() == Connections[i]->In->GetID())
290-
socket_index = j;
290+
SocketIndex = j;
291291
}
292-
ConnectionsData[std::to_string(i)]["in"]["socket_index"] = socket_index;
292+
ConnectionsData[std::to_string(i)]["in"]["socket_index"] = SocketIndex;
293293
ConnectionsData[std::to_string(i)]["in"]["node_ID"] = Connections[i]->In->GetParent()->GetID();
294294

295295
ConnectionsData[std::to_string(i)]["out"]["socket_ID"] = Connections[i]->Out->GetID();
296-
socket_index = 0;
296+
SocketIndex = 0;
297297
for (size_t j = 0; j < Connections[i]->Out->GetParent()->Output.size(); j++)
298298
{
299299
if (Connections[i]->Out->GetParent()->Output[j]->GetID() == Connections[i]->Out->GetID())
300-
socket_index = j;
300+
SocketIndex = j;
301301
}
302-
ConnectionsData[std::to_string(i)]["out"]["socket_index"] = socket_index;
302+
ConnectionsData[std::to_string(i)]["out"]["socket_index"] = SocketIndex;
303303
ConnectionsData[std::to_string(i)]["out"]["node_ID"] = Connections[i]->Out->GetParent()->GetID();
304304

305305
for (size_t j = 0; j < Connections[i]->RerouteNodes.size(); j++)
@@ -329,20 +329,20 @@ std::string NodeArea::ToJson() const
329329
ConnectionsData[std::to_string(i)]["reroute_connections"][std::to_string(j)]["end_reroute_ID"] = EndRerouteID;
330330
}
331331
}
332-
root["connections"] = ConnectionsData;
332+
Root["connections"] = ConnectionsData;
333333

334334
Json::Value GroupCommentsData;
335335
for (size_t i = 0; i < GroupComments.size(); i++)
336336
{
337337
GroupCommentsData[std::to_string(i)] = GroupComments[i]->ToJson();
338338
}
339-
root["GroupComments"] = GroupCommentsData;
339+
Root["GroupComments"] = GroupCommentsData;
340340

341-
root["renderOffset"]["x"] = RenderOffset.x;
342-
root["renderOffset"]["y"] = RenderOffset.y;
341+
Root["renderOffset"]["x"] = RenderOffset.x;
342+
Root["renderOffset"]["y"] = RenderOffset.y;
343343

344344
Json::StreamWriterBuilder builder;
345-
const std::string JsonText = Json::writeString(builder, root);
345+
const std::string JsonText = Json::writeString(builder, Root);
346346

347347
return JsonText;
348348
}

SubSystems/VisualNodeArea/VisualNodeAreaRendering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ void NodeArea::Render()
311311
CurrentDrawList->ChannelsSplit(4);
312312

313313
// We need to render comments first, because they should be on top layer.
314-
// Also font of comments should be bigger than font of nodes.
314+
// Also, the font for comments should be bigger than the font for nodes.
315315
Zoom *= 2.0f;
316316
SelectFontSettings();
317317
Zoom /= 2.0f;
@@ -550,7 +550,7 @@ void NodeArea::RenderConnection(const Connection* Connection) const
550550

551551
DrawHermiteLine(BeginPosition, EndPosition, Settings.Style.GeneralConnection.LineSegments, CurrentConnectionColor, &Connection->Style);
552552

553-
// If it is reroute than we should render circle.
553+
// If it is a reroute node, then we should render a circle.
554554
if (i > 0)
555555
RenderReroute(Connection->RerouteNodes[i - 1]);
556556
}

0 commit comments

Comments
 (0)