pinafore/src/routes/_utils/coordsToPercent.js
Nolan Lawson 85b75900c1
feat: add ability to set focal points for media (#1303)
* feat: add ability to set focal points for media

fixes #739

* fix tests

* actually fix tests

* really really fix tests

* really really really fix tests pinkie swear
2019-07-07 00:14:19 -07:00

3 lines
133 B
JavaScript

export const coordsToPercent = coord => ((1 + coord) / 2) * 100
export const percentToCoords = percent => ((percent / 100) * 2) - 1