mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-13 22:49:51 -04:00
Fixed onBackground for surface:stage-mouse-down events.
This commit is contained in:
parent
7f9ac5e573
commit
c70ffbeef5
1 changed files with 4 additions and 1 deletions
|
@ -482,7 +482,10 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
|
||||
onMouseDown: (e) =>
|
||||
return if @disabled
|
||||
onBackground = not @stage.hitTest e.stageX, e.stageY
|
||||
newPos = @camera.screenToCanvas({x: e.stageX, y: e.stageY})
|
||||
# getObject(s)UnderPoint is broken, so we have to use the private method to get what we want
|
||||
onBackground = not @stage._getObjectsUnderPoint(newPos.x, newPos.y, null, true)
|
||||
|
||||
worldPos = @camera.screenToWorld x: e.stageX, y: e.stageY
|
||||
event = onBackground: onBackground, x: e.stageX, y: e.stageY, originalEvent: e, worldPos: worldPos
|
||||
Backbone.Mediator.publish 'surface:stage-mouse-down', event
|
||||
|
|
Loading…
Reference in a new issue