1.0.16 • Published 4 years ago

@annoai/js-coord-converter v1.0.16

Weekly downloads
112
License
UNLICENSED
Repository
github
Last release
4 years ago

Node.js Unit Tests

NPM Audit Dependencies

js-coord-converter

Usage

Helper functions that can be used to convert xMin, xMax, yMin, yMax coordinates to top, left, width, height coordinates, and vice versa.

const xMin = 1
const xMax = 10
const yMin = 1
const yMax = 10

var coords = minMaxToCornerFormat(xMin, xMax, yMin, yMax)
console.log(coords)
// {top: 1, left: 1, width: 9, height: 9}

coords = cornerFormatToMinMax(coords.top, coords.left, coords.width, coords.height)
console.log(coords)
// {xMin: 1, yMin: 1, xMax: 10, yMax: 10}
1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago