zent
Version:
一套前端设计语言和基于React的实现
18 lines (14 loc) • 490 B
text/typescript
import { IPositionFunction } from '../position-function';
import createArrowPosition from './create';
const ArrowRightBottomPosition: IPositionFunction = ({
relativeRect,
contentRect,
cushion,
}) => {
const { right, top, bottom } = relativeRect;
const x = right + cushion;
const middle = (top + bottom) / 2;
const y = middle - (contentRect.height - __ARROW_OFFSET_VERTICAL__);
return createArrowPosition(x, y, `right-bottom`);
};
export default ArrowRightBottomPosition;