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

Function _alignOppositeEdges

docs/app/js/sanddance-app.js:31814–31819  ·  view source on GitHub ↗

* Aligns the targetEdge on the passed in target to the rects corresponding opposite edge. * For instance if targetEdge is bottom, then the rects top will be moved to match it.

(rect, target, targetEdge, gap)

Source from the content-addressed store, hash-verified

31812 * Aligns the targetEdge on the passed in target to the rects corresponding opposite edge.
31813 * For instance if targetEdge is bottom, then the rects top will be moved to match it.
31814 */ function _alignOppositeEdges(rect, target, targetEdge, gap) {
31815 if (gap === void 0) gap = 0;
31816 var oppositeEdge = targetEdge * -1;
31817 var adjustedGap = _getRelativeEdgeValue(oppositeEdge, gap);
31818 return _moveEdge(rect, targetEdge * -1, _getEdgeValue(target, targetEdge) + adjustedGap);
31819}
31820/**
31821 * Tests to see if the given edge is within the bounds of the given rectangle.
31822 */ function _isEdgeInBounds(rect, bounds, edge) {

Callers 1

_estimatePositionFunction · 0.85

Calls 3

_getRelativeEdgeValueFunction · 0.85
_moveEdgeFunction · 0.85
_getEdgeValueFunction · 0.85

Tested by

no test coverage detected