Merge pull request #10367 from RandomShaper/allow-zero-padded-series

Allow zero-padded serial naming
This commit is contained in:
Rémi Verschelde 2017-08-16 16:33:42 +02:00 committed by GitHub
commit ba68b2610c
1 changed files with 2 additions and 1 deletions

View File

@ -1301,8 +1301,9 @@ String Node::_generate_serial_child_name(Node *p_child) {
} }
} }
int num_places = nums.length();
for (;;) { for (;;) {
String attempt = (name + (num > 0 || explicit_zero ? nnsep + itos(num) : "")).strip_edges(); String attempt = (name + (num > 0 || explicit_zero ? nnsep + itos(num).pad_zeros(num_places) : "")).strip_edges();
bool found = false; bool found = false;
for (int i = 0; i < data.children.size(); i++) { for (int i = 0; i < data.children.size(); i++) {
if (data.children[i] == p_child) if (data.children[i] == p_child)