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

Function _finalizeBeakPosition

docs/app/js/sanddance-app.js:32042–32055  ·  view source on GitHub ↗
(elementPosition, positionedBeak, bounds)

Source from the content-addressed store, hash-verified

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.
32045 var actualElement = new (0, _utilities.Rectangle)(0, elementPosition.elementRectangle.width, 0, elementPosition.elementRectangle.height);
32046 var returnValue = {};
32047 var returnEdge = _finalizeReturnEdge(elementPosition.elementRectangle, elementPosition.alignmentEdge ? elementPosition.alignmentEdge : _getFlankingEdges(targetEdge).positiveEdge, bounds);
32048 returnValue[(0, _positioningTypes.RectangleEdge)[targetEdge]] = _getEdgeValue(positionedBeak, targetEdge);
32049 returnValue[(0, _positioningTypes.RectangleEdge)[returnEdge]] = _getRelativeEdgeDifference(positionedBeak, actualElement, returnEdge);
32050 return {
32051 elementPosition: (0, _tslib.__assign)({}, returnValue),
32052 closestEdge: getClosestEdge(elementPosition.targetEdge, positionedBeak, actualElement),
32053 targetEdge: targetEdge
32054 };
32055}
32056function _positionBeak(beakWidth, elementPosition) {
32057 var target = elementPosition.targetRectangle;
32058 /**

Callers 1

_positionCalloutFunction · 0.85

Calls 5

_finalizeReturnEdgeFunction · 0.85
_getFlankingEdgesFunction · 0.85
_getEdgeValueFunction · 0.85
getClosestEdgeFunction · 0.85

Tested by

no test coverage detected