MCPcopy Create free account
hub / github.com/angular/components / getRect

Function getRect

src/cdk-experimental/scrolling/virtual-scroll.e2e.spec.ts:132–142  ·  view source on GitHub ↗

Gets the rect for an element given its location ans size.

(
  location: webdriver.ILocation,
  size: webdriver.ISize,
)

Source from the content-addressed store, hash-verified

130
131/** Gets the rect for an element given its location ans size. */
132function getRect(
133 location: webdriver.ILocation,
134 size: webdriver.ISize,
135): {top: number; left: number; bottom: number; right: number} {
136 return {
137 top: location.y,
138 left: location.x,
139 bottom: location.y + size.height,
140 right: location.x + size.width,
141 };
142}
143
144/** Immediately scrolls the viewport to the given offset. */
145function scrollViewportTo(viewportEl: any, offset: number, done: () => void) {

Callers 1

isVisibleInViewportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected