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

Function _getCenterValue

docs/app/js/sanddance-app.js:31771–31774  ·  view source on GitHub ↗

* Returns the middle value of an edge. Only returns 1 value rather than xy coordinates as * the itself already contains the other coordinate. * For instance, a bottom edge's current value is it's y coordinate, so the number returned is the x.

(rect, edge)

Source from the content-addressed store, hash-verified

31769 * the itself already contains the other coordinate.
31770 * For instance, a bottom edge's current value is it's y coordinate, so the number returned is the x.
31771 */ function _getCenterValue(rect, edge) {
31772 var edges = _getFlankingEdges(edge);
31773 return (_getEdgeValue(rect, edges.positiveEdge) + _getEdgeValue(rect, edges.negativeEdge)) / 2;
31774}
31775/**
31776 * Flips the value depending on the edge.
31777 * If the edge is a "positive" edge, Top or Left, then the value should stay as it is.

Callers 4

_centerEdgeToPointFunction · 0.85
_estimatePositionFunction · 0.85
getClosestEdgeFunction · 0.85
_positionBeakFunction · 0.85

Calls 2

_getFlankingEdgesFunction · 0.85
_getEdgeValueFunction · 0.85

Tested by

no test coverage detected