| 372 | directionAgnosticContentOffset, directionAgnosticUnclampedContentOffset, directionAgnosticVelocity); |
| 373 | _onDragEndCallback->call(ValueFunctionFlagsBoundedMainThreadSync, &scrollEvent, 1); |
| 374 | } |
| 375 | |
| 376 | Result<std::optional<Point>> ViewNodeScrollState::notifyOnDragEnding( |
| 377 | const Point& directionAgnosticContentOffset, |
| 378 | const Point& directionAgnosticUnclampedContentOffset, |
| 379 | const Point& directionAgnosticVelocity) const { |
| 380 | if (_onDragEndingCallback == nullptr) { |
| 381 | return {std::nullopt}; |
| 382 | } |
| 383 | VALDI_TRACE("Valdi.notifyOnDragEnding") |
| 384 | |
| 385 | auto scrollEvent = makeScrollEvent( |
| 386 | directionAgnosticContentOffset, directionAgnosticUnclampedContentOffset, directionAgnosticVelocity); |
| 387 | |
| 388 | auto result = _onDragEndingCallback->callSyncWithDeadline(kInputSyncCallDeadline, &scrollEvent, 1); |
| 389 | if (!result) { |
| 390 | return result.moveError(); |
| 391 | } |
| 392 | |
| 393 | if (result.value().isNullOrUndefined()) { |
| 394 | return {std::nullopt}; |
| 395 | } |
| 396 | |
| 397 | if (!result.value().isMap()) { |
| 398 | return Error("Expecting Point object for onDragEnding"); |
| 399 | } |
| 400 | |
| 401 | return {Point(*result.value().getMap())}; |
| 402 | } |
| 403 | |
| 404 | void ViewNodeScrollState::notifyContentSizeChanged() const { |
no test coverage detected