createAligned2D<R extends Position> static method
R
createAligned2D<R extends Position>(
- Box box,
- CreatePosition<
R> factory, { - Aligned align = Aligned.center,
Returns an aligned 2D position relative to box
.
Implementation
static R createAligned2D<R extends Position>(
Box box,
CreatePosition<R> factory, {
Aligned align = Aligned.center,
}) =>
factory.call(
x: box.minX + box.width * (1.0 + align.x) / 2.0,
y: box.minY + box.height * (1.0 + align.y) / 2.0,
);