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

Function _flipAlignmentEdge

docs/app/js/sanddance-app.js:31876–31888  ·  view source on GitHub ↗

* Flips only the alignment edge of an element rectangle. This is used instead of nudging the alignment edges * into position, when alignTargetEdge is specified.

(elementEstimate, target, gap, coverTarget)

Source from the content-addressed store, hash-verified

31874 * Flips only the alignment edge of an element rectangle. This is used instead of nudging the alignment edges
31875 * into position, when alignTargetEdge is specified.
31876 */ function _flipAlignmentEdge(elementEstimate, target, gap, coverTarget) {
31877 var alignmentEdge = elementEstimate.alignmentEdge, targetEdge = elementEstimate.targetEdge, elementRectangle = elementEstimate.elementRectangle;
31878 var oppositeEdge = alignmentEdge * -1;
31879 var newEstimate = _estimatePosition(elementRectangle, target, {
31880 targetEdge: targetEdge,
31881 alignmentEdge: oppositeEdge
31882 }, gap, coverTarget);
31883 return {
31884 elementRectangle: newEstimate,
31885 targetEdge: targetEdge,
31886 alignmentEdge: oppositeEdge
31887 };
31888}
31889/**
31890 * Adjusts a element rectangle to fit within the bounds given. If directionalHintFixed or covertarget is passed in
31891 * then the element will not flip sides on the target. They will, however, be nudged to fit within the bounds given.

Callers 1

_adjustFitWithinBoundsFunction · 0.85

Calls 1

_estimatePositionFunction · 0.85

Tested by

no test coverage detected