-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some drag listener fixes + passing listener reference for convenience
- Loading branch information
1 parent
92a2872
commit 3c1d5db
Showing
2 changed files
with
18 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,11 +29,11 @@ | |
* 3. (optionally) map that to a model location, and (optionally) move that model location to satisfy any constraints of | ||
* where the element can be dragged (recomputing the parent/model translation as needed) | ||
* 4. Apply the required translation (with a provided drag callback, using the locationProperty, or directly | ||
* transforming the Node if translateNode:true. | ||
* transforming the Node if translateNode:true). | ||
* | ||
* TODO: unit tests | ||
* For example usage, see scenery/examples/input.html | ||
* | ||
* TODO: add example usage | ||
* TODO: unit tests | ||
* | ||
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
|
@@ -89,12 +89,12 @@ define( function( require ) { | |
// mapLocation: function( point ) { return dragBounds.closestPointTo( point ); } | ||
mapLocation: null, | ||
|
||
// {Function|null} - Called as start( event: {Event} ) when the drag is started. This is preferred over passing | ||
// press(), as the drag start hasn't been fully processed at that point. | ||
// {Function|null} - Called as start( event: {Event}, listener: {DragListener} ) when the drag is started. | ||
// This is preferred over passing press(), as the drag start hasn't been fully processed at that point. | ||
start: null, | ||
|
||
// {Function|null} - Called as end() when the drag is ended. This is preferred over passing release(), as the | ||
// drag start hasn't been fully processed at that point. | ||
// {Function|null} - Called as end( listener: {DragListener} ) when the drag is ended. This is preferred over | ||
// passing release(), as the drag start hasn't been fully processed at that point. | ||
end: null | ||
}, options ); | ||
|
||
|
@@ -168,7 +168,7 @@ define( function( require ) { | |
this.reposition( this.pointer.point ); | ||
|
||
// Notify after positioning and other changes | ||
this._start && this._start( event ); | ||
this._start && this._start( event, this ); | ||
|
||
sceneryLog && sceneryLog.InputListener && sceneryLog.pop(); | ||
} | ||
|
@@ -196,7 +196,7 @@ define( function( require ) { | |
|
||
// Notify after the rest of release is called in order to prevent it from triggering interrupt(). | ||
// TODO: Is this a problem that we can't access things like this.pointer here? | ||
this._end && this._end(); | ||
this._end && this._end( this ); | ||
|
||
sceneryLog && sceneryLog.InputListener && sceneryLog.pop(); | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters