Added :d to mouse shapes

This commit is contained in:
Devine Lu Linvega
2019-07-26 12:21:50 +09:00
parent c88968bf05
commit bcd98907c9
4 changed files with 19 additions and 41 deletions

View File

@@ -113,7 +113,6 @@ function Lisp (lib = {}, includes = []) {
const interpret = async function (input, context) {
if (!input) { console.warn('Lisp', 'error', context.scope); return null }
if (context === undefined) {
return interpret(input, new Context(lib))
} else if (input instanceof Array) {

View File

@@ -126,13 +126,13 @@ function Ronin () {
a: { x: this.mouseOrigin.x, y: this.mouseOrigin.y },
b: { x: pos.x, y: pos.y }
}
const distance = Math.sqrt(((line.a.x - line.b.x) * (line.a.x - line.b.x)) + ((line.a.y - line.b.y) * (line.a.y - line.b.y)))
const d = Math.sqrt(((line.a.x - line.b.x) * (line.a.x - line.b.x)) + ((line.a.y - line.b.y) * (line.a.y - line.b.y)))
const circle = {
cx: this.mouseOrigin.x,
cy: this.mouseOrigin.y,
r: distance
r: d
}
return { x, y, line, rect, pos, circle, type, 'is-down': type !== 'mouse-up' ? true : null }
return { x, y, d, line, rect, pos, circle, type, 'is-down': type !== 'mouse-up' ? true : null }
}
// Zoom