Working on tap behavior of scatter and flippables.

This commit is contained in:
2019-07-05 13:43:39 +02:00
parent 30e998e386
commit 20ac5c387e
7 changed files with 416 additions and 203 deletions
+7
View File
@@ -402,6 +402,13 @@ export class Points {
return Math.sqrt(dx * dx + dy * dy)
}
// Distance == 0.0 indicates an inside relation.
static distanceToRect(p, r) {
var cx = Math.max(Math.min(p.x, r.x + r.width), r.x)
var cy = Math.max(Math.min(p.y, r.y + r.height), r.y)
return Math.sqrt((p.x - cx) * (p.x - cx) + (p.y - cy) * (p.y - cy))
}
static fromPageToNode(element, p) {
// if (window.webkitConvertPointFromPageToNode) {
// return window.webkitConvertPointFromPageToNode(element,