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

Method onFrameChanged

valdi/src/valdi/runtime/Context/ViewNodesFrameObserver.cpp:46–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void ViewNodesFrameObserver::onFrameChanged(RawViewNodeId id, const Frame& frame) {
47 if (_values == nullptr) {
48 _values = makeShared<ByteBuffer>();
49 }
50
51 FrameChangeEvent event = {
52 .id = static_cast<double>(id),
53 .x = static_cast<double>(frame.x),
54 .y = static_cast<double>(frame.y),
55 .width = static_cast<double>(frame.width),
56 .height = static_cast<double>(frame.height),
57 };
58
59 _values->append(reinterpret_cast<const Byte*>(&event), reinterpret_cast<const Byte*>(&event) + sizeof(event));
60}
61
62void ViewNodesFrameObserver::appendCompleteCallback(const Ref<ValueFunction>& callback) {
63 _layoutCompletedCallbacks.emplace_back(callback);

Callers 1

layoutFinishedMethod · 0.45

Calls 1

appendMethod · 0.65

Tested by

no test coverage detected