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

Function _positionElementWithinBounds

docs/app/js/sanddance-app.js:32033–32041  ·  view source on GitHub ↗
(elementToPosition, target, bounding, positionData, gap, directionalHintFixed, coverTarget)

Source from the content-addressed store, hash-verified

32031 else return negativeEdge;
32032}
32033function _positionElementWithinBounds(elementToPosition, target, bounding, positionData, gap, directionalHintFixed, coverTarget) {
32034 var estimatedElementPosition = _estimatePosition(elementToPosition, target, positionData, gap, coverTarget);
32035 if (_isRectangleWithinBounds(estimatedElementPosition, bounding)) return {
32036 elementRectangle: estimatedElementPosition,
32037 targetEdge: positionData.targetEdge,
32038 alignmentEdge: positionData.alignmentEdge
32039 };
32040 else return _adjustFitWithinBounds(elementToPosition, target, bounding, positionData, gap, directionalHintFixed, coverTarget);
32041}
32042function _finalizeBeakPosition(elementPosition, positionedBeak, bounds) {
32043 var targetEdge = elementPosition.targetEdge * -1;
32044 // The "host" element that we will use to help position the beak.

Callers 1

_positionElementRelativeFunction · 0.85

Calls 3

_estimatePositionFunction · 0.85
_isRectangleWithinBoundsFunction · 0.85
_adjustFitWithinBoundsFunction · 0.85

Tested by

no test coverage detected