bux fixing issue #67: Chrome now treats the event target attributes like Firefox, so no need for distinction anymore.
This commit is contained in:
parent
64763e8ce1
commit
3128ac7765
1 changed files with 3 additions and 8 deletions
|
|
@ -132,14 +132,9 @@ $(function(){
|
||||||
};
|
};
|
||||||
|
|
||||||
self.getXYCoord = function(evt){
|
self.getXYCoord = function(evt){
|
||||||
if(isFirefox) {
|
|
||||||
var scale = evt.target.parentElement.transform.baseVal[0].matrix.a;
|
var scale = evt.target.parentElement.transform.baseVal[0].matrix.a;
|
||||||
var x = self.px2mm(evt.offsetX) * scale;
|
var x = self.px2mm(evt.offsetX) * scale;
|
||||||
var y = self.px2mm(parseFloat(evt.target.attributes.height.value) - evt.offsetY) * 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
|
|
||||||
}
|
|
||||||
x = Math.min(x, self.workingAreaWidthMM());
|
x = Math.min(x, self.workingAreaWidthMM());
|
||||||
y = Math.min(y, self.workingAreaHeightMM());
|
y = Math.min(y, self.workingAreaHeightMM());
|
||||||
return {x:x, y:y};
|
return {x:x, y:y};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue