@projectstorm/geometry
Version:
25 lines • 903 B
JavaScript
import { Point } from './Point';
export var BoundsCorner;
(function (BoundsCorner) {
BoundsCorner["TOP_LEFT"] = "TL";
BoundsCorner["TOP_RIGHT"] = "TR";
BoundsCorner["BOTTOM_RIGHT"] = "BR";
BoundsCorner["BOTTOM_LEFT"] = "BL";
})(BoundsCorner || (BoundsCorner = {}));
export const boundsFromPositionAndSize = (x, y, width, height) => {
return {
[ ]: new Point(x, y),
[ ]: new Point(x + width, y),
[ ]: new Point(x + width, y + height),
[ ]: new Point(x, y + height)
};
};
export const createEmptyBounds = () => {
return {
[ ]: new Point(),
[ ]: new Point(),
[ ]: new Point(),
[ ]: new Point()
};
};
//# sourceMappingURL=Bounds.js.map