mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
fix(runner): restore scrollBounds doc; cover destination clamp and screenBounds
Review fixes: move the scrollBounds doc comment back onto scrollBounds (it was stranded above screenBounds by an insertion). Extend the clamp test to assert an off-screen destination is clamped onto the screen and that the origin lands exactly on the margin.
This commit is contained in:
1 parent
c48b13f304
commit
896cfc2cb5
2 files changed
+13
-8
No files matched your search
@@ -719,8 +719,6 @@ func scrollEndpoints(action verifier.Action, tree *hierarchy.Tree) (fromX, fromY
|
||||
return cx, cy, toX, toY
|
||||
}
|
||||
|
||||
// scrollBounds returns the container bounds for an authored Scroll: the node
|
||||
// named by On when it resolves, otherwise the root (whole-screen) bounds.
|
||||
// screenBounds returns the device screen rectangle as the maximum extent across
|
||||
// all elements. The hierarchy root often reports zero bounds on Android, so the
|
||||
// extent (driven by full-screen containers and the navigation bar) is the
|
||||
@@ -773,6 +771,8 @@ func clampGestureToSafeArea(fromX, fromY, toX, toY int, screen hierarchy.Bounds)
|
||||
return fromX, fromY, toX, toY
|
||||
}
|
||||
|
||||
// scrollBounds returns the container bounds for an authored Scroll: the node
|
||||
// named by On when it resolves, otherwise the root (whole-screen) bounds.
|
||||
func scrollBounds(action verifier.Action, tree *hierarchy.Tree) hierarchy.Bounds {
|
||||
if tree == nil {
|
||||
return hierarchy.Bounds{}
|
||||
|
||||
Reference in new issue
Block a user