mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Minor code refactoring
This commit is contained in:
parent
1bd67b2d9b
commit
3fd73f92f2
2 changed files with 6 additions and 17 deletions
|
@ -1506,22 +1506,11 @@ new function() { // Injection scope for event handling on the browser
|
|||
* test.
|
||||
* @private
|
||||
*/
|
||||
_clearState: function() {
|
||||
prevFocus = null;
|
||||
tempFocus = null;
|
||||
dragging = false;
|
||||
mouseDown = false;
|
||||
called = false;
|
||||
wasInView = false;
|
||||
overView = null;
|
||||
downPoint = null;
|
||||
lastPoint = null;
|
||||
downItem = null;
|
||||
overItem = null;
|
||||
dragItem = null;
|
||||
clickItem = null;
|
||||
clickTime = null;
|
||||
dblClick = null;
|
||||
_resetState: function() {
|
||||
dragging = mouseDown = called = wasInView = false;
|
||||
prevFocus = tempFocus = overView = downPoint = lastPoint =
|
||||
downItem = overItem = dragItem = clickItem = clickTime =
|
||||
dblClick = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -69,7 +69,7 @@ var test = function(testName, expected) {
|
|||
currentProject.remove();
|
||||
// This is needed for interactions tests, to make sure that test is
|
||||
// run with a fresh state.
|
||||
View._clearState();
|
||||
View._resetState();
|
||||
}
|
||||
|
||||
// Instantiate project with 100x100 pixels canvas instead of default
|
||||
|
|
Loading…
Reference in a new issue