-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Live Cursors Interpolation #275
Comments
hey @suvamsh - I've created a repo with an example implementation, https://github.com/ably-labs/responsive-cursors-example. It also uses scaling and shows the potential problems of fixed/dynamic elements within a canvas. It's a bit tricky to get a sense of what might be wrong just from the sample you posted. |
hey @dpiatek - Just to give some clarity on the adjusted_scale_x, that was simply an attempt on our part as the x positioning appears to be the problem. Our y positioning is just fine, yet our x is off, so we attempted with an adjusted_scale_x to see what type of effect it had, it really didnt do much haha. Anyways, I've since attempted using the example implementation you provided above, running into the same issue, its just simply not lining up, again mainly with the x positioning being the problem. Below I'll list some snippets maybe you can look at to see if I missed something, but the math between our attempts (not necessarily the code that was provided) is extremely similar to yours. To also give more clarity we are not using the full width of the screen, our canvas take up a rough % so we use the width and height of it, instead of the window
Not sure if maybe I messed something up, but this was based off your github repo |
We're using the ably live cursors (via spaces) for a collaboration feature in our product. When clients are using different sized screens the cursors are not being interpolated correctly hence they show up in the wrong position on clients. I've attempted to solve this by converting the (x,y) position from pixels to a percentage of the canvas but it is still wrong for the horizontal X axis.
percentage = (position / canvasLen) * 100
Thew above formula is applied to the X and Y axis. I've also tried to scale the pixel positions like below (which also doesn't work):
Please share any examples or cases of how to do this using Ably.
The text was updated successfully, but these errors were encountered: