mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -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;
|
return event.target || event.srcElement;
|
||||||
},
|
},
|
||||||
|
|
||||||
getOffset: function(event) {
|
getOffset: function(event, target) {
|
||||||
// Remove target offsets from page coordinates
|
// Remove target offsets from page coordinates
|
||||||
return DomEvent.getPoint(event).subtract(
|
return DomEvent.getPoint(event).subtract(
|
||||||
DomElement.getOffset(DomEvent.getElement(event), true));
|
DomElement.getOffset(target || DomEvent.getElement(event), true));
|
||||||
},
|
},
|
||||||
|
|
||||||
preventDefault: function(event) {
|
preventDefault: function(event) {
|
||||||
|
|
Loading…
Reference in a new issue