kripken/emscripten — pull request #958 by caiiiycuk (2013-03-17 05:18:25+00:00)
Title: Fix offsets for canvas

If canvas embedded in div with ```position: absolute``` then simple call to Module['canvas'].offset Top|Left not enough to get mouse position.

```
.canvas {
position: absolute;
left: 0;
width: 100%;
top: 43px;
bottom: 0;
}

.canvas #canvas {
position: absolute;
left: 0;
width: 100%;
top: 0px;
height: 100%;
}
//...

```

In the snippet call to Module['canvas'].offsetTop returns 0, but real offset is 43px. So i fixed the code, but maybe i should implement cache for offset.