| 44 | } |
| 45 | |
| 46 | void 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 | |
| 62 | void ViewNodesFrameObserver::appendCompleteCallback(const Ref<ValueFunction>& callback) { |
| 63 | _layoutCompletedCallbacks.emplace_back(callback); |