MCPcopy Create free account
hub / github.com/microsoft/SandDance / _finalizeReturnEdge

Function _finalizeReturnEdge

docs/app/js/sanddance-app.js:31968–31971  ·  view source on GitHub ↗

* Retrieve the final value for the return edge of elementRectangle. If the elementRectangle is closer to one side * of the bounds versus the other, the return edge is flipped to grow inward.

(elementRectangle, returnEdge, bounds)

Source from the content-addressed store, hash-verified

31966 * Retrieve the final value for the return edge of elementRectangle. If the elementRectangle is closer to one side
31967 * of the bounds versus the other, the return edge is flipped to grow inward.
31968 */ function _finalizeReturnEdge(elementRectangle, returnEdge, bounds) {
31969 if (bounds && Math.abs(_getRelativeEdgeDifference(elementRectangle, bounds, returnEdge)) > Math.abs(_getRelativeEdgeDifference(elementRectangle, bounds, returnEdge * -1))) return returnEdge * -1;
31970 return returnEdge;
31971}
31972/**
31973 * Finalizes the element positon based on the hostElement. Only returns the
31974 * rectangle values to position such that they are anchored to the target.

Callers 2

_finalizeElementPositionFunction · 0.85
_finalizeBeakPositionFunction · 0.85

Calls 1

Tested by

no test coverage detected