StageXL
StageXL copied to clipboard
click (and touch?) events problem with large canvas size
I have a project where the canvas exceeds the boundaries of the browser window, and I show scroll bars.
Click events work fine as long as I do not scroll, as soon as I scroll, it seems that the offset X and Y are not calculated correctly.
My findings =>
- start app, screen renders, canvas resizes and scroll bars show
- I do not scroll, but place my mouse over a clickable item
- Now I scroll down, so that the item moves up, since I leave my mouse cursor stationary, I would now click on nothing.
- I click, and the item onMouseClick triggers, even though it has moved out of my mouse pointer's reach.
Okay that sounds bad. I will take a look at it!
I was able to resolve it :)
It is not a stagexl issue directly, I am using StageRenderMode.ONCE, and I assume that you recalculate hit areas only upon materializing, because simply triggering a render on scroll, or switching to AUTO mode resolves it.
Okay great :) Happy to hear that it is not a StageXL issue! Please don't hesitate to send other bug reports at any time.
Sorry I had only checked with RenderMode.Canvas2D, when I switch to WebGL, it still behaves funny
The mouse events should work the same regardless if the renderer is Canvas2D or WebGL. It would help if you could provide a repro case, otherwise i would need to build my own.
Sure thing sorry :) https://github.com/frankpepermans/flow
Also having dart2js issues here, but that could be non stagexl stuff