fix for the chrome 50 changes where they removed the SVGElement.offset* attributes.

This commit is contained in:
make-ing 2016-04-15 15:42:04 +02:00
parent e54364a45c
commit dc23dac20c

View file

@ -102,11 +102,11 @@ $(function(){
self.availableWidth($('#workingarea div.span8').innerWidth());
};
self.move_laser = function(el){
self.move_laser = function(data, evt){
self.abortFreeTransforms();
if(self.state.isOperational() && !self.state.isPrinting()){
var x = self.px2mm(event.offsetX);
var y = self.px2mm(event.toElement.ownerSVGElement.offsetHeight - event.offsetY); // hopefully this works across browsers
var x = self.px2mm(evt.offsetX);
var y = self.px2mm(evt.toElement.ownerSVGElement.getBoundingClientRect().height - evt.offsetY); // hopefully this works across browsers
x = Math.min(x, self.workingAreaWidthMM());
y = Math.min(y, self.workingAreaHeightMM());
$.ajax({