MCPcopy Create free account
hub / github.com/Snapchat/Valdi / removeChild

Method removeChild

snap_drawing/src/snap_drawing/cpp/Layers/Layer.cpp:252–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250void Layer::onChildRemoved(Layer* /*childLayer*/) {}
251
252void Layer::removeChild(Layer* childLayer, bool shouldNotify) {
253 auto erased = false;
254 {
255 auto children = _children.writeAccess();
256 auto it = children->begin();
257 while (it != children->end()) {
258 if (it->get() == childLayer) {
259 it = children->erase(it);
260 erased = true;
261 } else {
262 it++;
263 }
264 }
265 }
266
267 if (erased) {
268 if (shouldNotify) {
269 onChildRemoved(childLayer);
270 }
271 setChildNeedsDisplay();
272 }
273}
274
275void Layer::removeFromParent() {
276 removeFromParent(true);

Callers 1

removeFromParentMethod · 0.45

Calls 5

endMethod · 0.65
getMethod · 0.65
writeAccessMethod · 0.45
beginMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected