Remove the child shape with index idx.
(int idx)
| 2082 | * Remove the child shape with index idx. |
| 2083 | */ |
| 2084 | public void removeChild(int idx) { |
| 2085 | if (idx < childCount) { |
| 2086 | PShape child = children[idx]; |
| 2087 | |
| 2088 | // Copy [idx + 1, childCount - 1] to [idx, childCount - 2] |
| 2089 | for (int i = idx; i < childCount - 1; i++) { |
| 2090 | children[i] = children[i + 1]; |
| 2091 | } |
| 2092 | childCount--; |
| 2093 | |
| 2094 | if (child.getName() != null && nameTable != null) { |
| 2095 | nameTable.remove(child.getName()); |
| 2096 | } |
| 2097 | } |
| 2098 | } |
| 2099 | |
| 2100 | |
| 2101 | /** |