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

Function _getAlignmentData

docs/app/js/sanddance-app.js:32021–32025  ·  view source on GitHub ↗

* Get's the alignment data for the given information. This only really matters if the positioning is Auto. * If it is auto then the alignmentEdge should be chosen based on the target edge's position relative to * the center of the page.

(positionData, target, boundingRect, coverTarget, alignTargetEdge)

Source from the content-addressed store, hash-verified

32019 * If it is auto then the alignmentEdge should be chosen based on the target edge's position relative to
32020 * the center of the page.
32021 */ function _getAlignmentData(positionData, target, boundingRect, coverTarget, alignTargetEdge) {
32022 if (positionData.isAuto) positionData.alignmentEdge = getClosestEdge(positionData.targetEdge, target, boundingRect);
32023 positionData.alignTargetEdge = alignTargetEdge;
32024 return positionData;
32025}
32026function getClosestEdge(targetEdge, target, boundingRect) {
32027 var targetCenter = _getCenterValue(target, targetEdge);
32028 var boundingCenter = _getCenterValue(boundingRect, targetEdge);

Callers 1

_positionElementRelativeFunction · 0.85

Calls 1

getClosestEdgeFunction · 0.85

Tested by

no test coverage detected