Skip to content

Commit

Permalink
Adds Event properties and Layer shortcuts for focus, unfocus, selected.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Marstall committed Oct 16, 2017
1 parent 369c7ef commit d399737
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions FocusEngine.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,10 @@ measureDistance = (target, direction) ->
# Pythagorean theorem to measure the hypoteneuse
absoluteDistance = Math.sqrt(distanceX * distanceX + distanceY * distanceY)
return absoluteDistance

Events.Focus = "focus"
Layer::onFocus = (cb) -> @on(Events.Focus, cb)
Events.Unfocus = "unfocus"
Layer::onUnfocus = (cb) -> @on(Events.Unfocus, cb)
Events.Selected = "selected"
Layer::onSelected = (cb) -> @on(Events.Selected, cb)

0 comments on commit d399737

Please sign in to comment.