PositionUtil.js 211 B

1234567891011121314
  1. export function center(bounds) {
  2. return {
  3. x: bounds.x + (bounds.width / 2),
  4. y: bounds.y + (bounds.height / 2)
  5. };
  6. }
  7. export function delta(a, b) {
  8. return {
  9. x: a.x - b.x,
  10. y: a.y - b.y
  11. };
  12. }