[apps/code] Do not display varbox source name if it does not fit

This commit is contained in:
Léa Saviot
2020-04-29 10:16:47 +02:00
committed by Émilie Feral
parent 4fb0a7e467
commit d8cab18eb3
3 changed files with 23 additions and 7 deletions

View File

@@ -936,6 +936,10 @@ void VariableBoxController::addNode(ScriptNode::Type type, NodeOrigin origin, co
for (int i = *currentNodeCount - 1; i >= insertionIndex; i--) {
nodes[i+1] = nodes[i];
}
// Check if the node source name fits, if not, do not use it
if (!ScriptNodeCell::CanDisplayNameAndSource(nameLength, nodeSourceName)) {
nodeSourceName = nullptr;
}
// Add the node
nodes[insertionIndex] = ScriptNode(type, name, nameLength, nodeSourceName, description);
// Increase the node count