mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Allow the optional overriding of target in DomEvent.getOffset().
This commit is contained in:
parent
f6fdbd349d
commit
8361f513ed
1 changed files with 2 additions and 2 deletions
|
@ -58,10 +58,10 @@ var DomEvent = {
|
|||
return event.target || event.srcElement;
|
||||
},
|
||||
|
||||
getOffset: function(event) {
|
||||
getOffset: function(event, target) {
|
||||
// Remove target offsets from page coordinates
|
||||
return DomEvent.getPoint(event).subtract(
|
||||
DomElement.getOffset(DomEvent.getElement(event), true));
|
||||
DomElement.getOffset(target || DomEvent.getElement(event), true));
|
||||
},
|
||||
|
||||
preventDefault: function(event) {
|
||||
|
|
Loading…
Reference in a new issue