bux fixing issue #67: Chrome now treats the event target attributes like Firefox, so no need for distinction anymore.
(cherry picked from commit 3128ac7)
This commit is contained in:
parent
48f5b659e1
commit
16d2e18daa
1 changed files with 3 additions and 8 deletions
|
|
@ -132,14 +132,9 @@ $(function(){
|
|||
};
|
||||
|
||||
self.getXYCoord = function(evt){
|
||||
if(isFirefox) {
|
||||
var scale = evt.target.parentElement.transform.baseVal[0].matrix.a;
|
||||
var x = self.px2mm(evt.offsetX) * scale;
|
||||
var y = self.px2mm(parseFloat(evt.target.attributes.height.value) - evt.offsetY) * scale;
|
||||
} else {
|
||||
var x = self.px2mm(evt.offsetX);
|
||||
var y = self.px2mm(evt.target.ownerSVGElement.getBoundingClientRect().height - evt.offsetY); // hopefully this works across browsers
|
||||
}
|
||||
var scale = evt.target.parentElement.transform.baseVal[0].matrix.a;
|
||||
var x = self.px2mm(evt.offsetX) * scale;
|
||||
var y = self.px2mm(parseFloat(evt.target.attributes.height.value) - evt.offsetY) * scale;
|
||||
x = Math.min(x, self.workingAreaWidthMM());
|
||||
y = Math.min(y, self.workingAreaHeightMM());
|
||||
return {x:x, y:y};
|
||||
|
|
|
|||
Loading…
Reference in a new issue