* Moves the middle point on an edge to the point given. * Only moves in one direction. For instance if a bottom edge is passed in, then * the bottom edge will be moved in the x axis to match the point.
(rect, edge, point)
| 31928 | * Only moves in one direction. For instance if a bottom edge is passed in, then |
| 31929 | * the bottom edge will be moved in the x axis to match the point. |
| 31930 | */ function _centerEdgeToPoint(rect, edge, point) { |
| 31931 | var positiveEdge = _getFlankingEdges(edge).positiveEdge; |
| 31932 | var elementMiddle = _getCenterValue(rect, edge); |
| 31933 | var distanceToMiddle = elementMiddle - _getEdgeValue(rect, positiveEdge); |
| 31934 | return _moveEdge(rect, positiveEdge, point - distanceToMiddle); |
| 31935 | } |
| 31936 | /** |
| 31937 | * Moves the element rectangle to be appropriately positioned relative to a given target. |
| 31938 | * Does not flip or adjust the element. |
no test coverage detected