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

Function _getRelativeEdgeValue

docs/app/js/sanddance-app.js:31785–31788  ·  view source on GitHub ↗

* Flips the value depending on the edge. * If the edge is a "positive" edge, Top or Left, then the value should stay as it is. * If the edge is a "negative" edge, Bottom or Right, then the value should be flipped. * This is to account for the fact that the coordinates are effectively reveserved i

(edge, value)

Source from the content-addressed store, hash-verified

31783 * If edge 1 is greater than edge 2 then it is out of bounds. This is reversed for top edge 1 and top edge 2.
31784 * If top edge 1 is less than edge 2 then it is out of bounds.
31785 */ function _getRelativeEdgeValue(edge, value) {
31786 if (edge > 0) return value;
31787 else return value * -1;
31788}
31789function _getRelativeRectEdgeValue(edge, rect) {
31790 return _getRelativeEdgeValue(edge, _getEdgeValue(rect, edge));
31791}

Callers 4

_alignEdgesFunction · 0.85
_alignOppositeEdgesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected