Track mouse movements over a 3d rotated and scaled canvas element
Test purpose
- Create a Scrawl-canvas stack <div>, containing a <canvas> element.
- Set the canvas so that it uses a local mouse tracking function
- Add a Wheel entity to the canvas, which will track the mouse cursor's position
- Add a second Wheel entity whose position we shall manually update so that it matches the mouse event object's `offsetX` and `offsetY` values
- Position and rotate the canvas within the stack, checking repeatedly that both Wheel entitys continue to track the mouse cursor position
Known issues
- Resizing the canvas (dimensions attributes) will lead to positioning failures.
- The positioning accuracy on 3D-rotated canvases is not as accurate in Firefox as it is in other browsers.
Annotated code