place-box

Places a box within a boundary using a set of coordinates

Usage no npm install needed!

<script type="module">
  import placeBox from 'https://cdn.skypack.dev/place-box';
</script>

README

Place Box

Places a box within a boundary using a set of coordinates.

npm module Coverage Status Build Status Dependencies devDependencies Status

placeBox({
  boundary: { width: 200, height: 100 },
  coordinates: { x: 100, y: 50 },
  box: { width: 50, height: 50 },
});
// => { left: 75, top: 25 }