| 61 | setValdiViewNodeToLayer(*layer, viewNode); |
| 62 | } |
| 63 | |
| 64 | void SnapDrawingViewTransaction::insertChildView(const Ref<View>& view, |
| 65 | const Ref<View>& childView, |
| 66 | int index, |
| 67 | const Ref<Animator>& animator) { |
| 68 | auto parent = toLayer(view); |
| 69 | auto child = toLayer(childView); |
| 70 | if (parent == nullptr || child == nullptr) { |
| 71 | return; |
| 72 | } |
| 73 | |
| 74 | auto* childInsertionLayerProvider = dynamic_cast<IChildInsertionLayerProvider*>(parent.get()); |
| 75 | if (childInsertionLayerProvider != nullptr) { |
| 76 | childInsertionLayerProvider->getChildInsertionLayer().insertChild(child, static_cast<size_t>(index)); |
| 77 | auto scrollView = Valdi::castOrNull<ScrollLayer>(parent); |
| 78 | if (scrollView != nullptr) { |
| 79 | auto viewNode = snap::drawing::valdiViewNodeFromLayer(*scrollView); |
| 80 | if (viewNode != nullptr) { |
| 81 | scrollView->setHorizontal(viewNode->isHorizontal()); |
| 82 | } |
| 83 | } |
| 84 | } else { |
| 85 | parent->insertChild(child, static_cast<size_t>(index)); |
| 86 | } |
| 87 | } |
nothing calls this directly
no test coverage detected