caleb531/jcanvas — Issue #8: "offset is null" error when $(event.target).offset() returns null
Author: edoceo
Created: 2012-02-28 18:25:31+00:00
State: open

Using Firefox 10 on 64bit Linux I got this error. The event that creates the issue for me is a resize; which has no offset.

So, line 1102 should check that offset is a real value before reading it

// Currently:
```javascript
var offset = $(event.target).offset();
event.offsetX = event.pageX - offset.left;
event.offsetY = event.pageY - offset.top;
```

// Fixed it with:
```javascript
var offset = $(event.target).offset();
if (offset) {
event.offsetX = event.pageX - offset.
event.offsetY = event.pageY - offset.top;
}
```