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

Method submitScrollEvent

valdi/src/valdi/runtime/Context/ViewNodeScrollState.cpp:278–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278void ViewNodeScrollState::submitScrollEvent(const Ref<ValueFunction>& callback,
279 ValueFunctionFlags callFlags,
280 const Point& directionAgnosticContentOffset,
281 const Point& directionAgnosticUnclampedContentOffset,
282 const Point& directionAgnosticVelocity) {
283 auto touchEvent = TouchEvents::makeScrollEvent(static_cast<double>(directionAgnosticContentOffset.x),
284 static_cast<double>(directionAgnosticContentOffset.y),
285 static_cast<double>(directionAgnosticUnclampedContentOffset.x),
286 static_cast<double>(directionAgnosticUnclampedContentOffset.y),
287 static_cast<double>(directionAgnosticVelocity.x),
288 static_cast<double>(directionAgnosticVelocity.y));
289
290 (*callback)(callFlags, {std::move(touchEvent)});
291}
292
293void ViewNodeScrollState::submitScrollEndEvent(const Ref<ValueFunction>& callback,
294 ValueFunctionFlags callFlags,

Callers

nothing calls this directly

Calls 1

makeScrollEventFunction · 0.85

Tested by

no test coverage detected