Skip to content

Multiplayer cursor position inside canvas #70

Description

@alquist42

Hello again :)

I'm trying to play with multiplayer presence technology and to show the other participant cursor position inside invinite viewer.

infinite-viewer-cursors

But as you can see the cursors have window position and not adjusted to scrolled area and not to zoom of the invinite viewer.
For example, when one cursor on "div 5" second on "div 4"
I've tried couple of things of adjusting relativly to container, but no luck yet...

Can you please advise of how to adjust the coordinate to reflect the real world inside the canvas?


Playground: codesandbox
(hot reload breaks sometime, so need to refresh manualy, you can add second preview tab)


A huge thanks anyway!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions