Skip to content

Canvas mouse events coord is wrong on layout change #200

@DreadPirateSergey

Description

@DreadPirateSergey

You calculate local coordinates there based on evt.pageX/evt.pageY and canvas page bounds. Element page bounds variable gets updated on "resize" page event(and manual "resize" calls), but page layout may be changed all the time(some data is loaded and element above chart became bigger for example).
Easiest fix is to use evt.offsetX/evt.offsetY, but this also highlight problem with "bounds" variable, better not to use it if possible since there is no performant tracker of element position.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions