mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Change the way canvases get temporarily focused when there is more than one and the mouse is outside all of them.
Closes #115.
This commit is contained in:
parent
20797b8cc3
commit
7096b37b2e
1 changed files with 3 additions and 1 deletions
|
@ -474,6 +474,7 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
|
|||
/*#*/ if (options.browser) {
|
||||
var tool,
|
||||
curPoint,
|
||||
prevFocus,
|
||||
tempFocus,
|
||||
dragging = false;
|
||||
|
||||
|
@ -525,10 +526,11 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
|
|||
if (view) {
|
||||
// Temporarily focus this view without making it sticky, so
|
||||
// Key events are handled too during the mouse over
|
||||
prevFocus = View._focused;
|
||||
View._focused = tempFocus = view;
|
||||
} else if (tempFocus && tempFocus == View._focused) {
|
||||
// Clear temporary focus again and update it.
|
||||
View._focused = null;
|
||||
View._focused = prevFocus;
|
||||
updateFocus();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue