summaryrefslogtreecommitdiff
path: root/frontend/util/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-06-03 16:47:51 +0200
committerJules Laplace <julescarbon@gmail.com>2020-06-03 16:47:51 +0200
commit3e9de575501fd1945b8341f7a4e3a89b73e3cb03 (patch)
treef3adbe4177b2287e9dd2380a19e3260f82aaf3bb /frontend/util/index.js
parentabd277bc02d36570038de4c0646a672f5585fa84 (diff)
getting to the page editor with add tile form
Diffstat (limited to 'frontend/util/index.js')
-rw-r--r--frontend/util/index.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/frontend/util/index.js b/frontend/util/index.js
index b1b103c..02a7a4d 100644
--- a/frontend/util/index.js
+++ b/frontend/util/index.js
@@ -67,6 +67,7 @@ export const percent = n => (n * 100).toFixed(1) + '%'
export const px = (n, w) => Math.round(n * w) + 'px'
export const clamp = (n, a=0, b=1) => n < a ? a : n < b ? n : b
+export const dist = (x1, y1, x2, y2) => Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2))
/* URLs */