spacedeck / spacedeck-open

Spacedeck, a web based, real time, collaborative whiteboard application with rich media support
GNU Affero General Public License v3.0
1.01k stars 243 forks source link

Cursor positions on shared whiteboards are inconsistent #71

Closed yrammos closed 4 years ago

yrammos commented 4 years ago

On a whiteboard shared between User A and User B, User A's cursor is displayed on User B's display at an incorrect position. This makes remote collaboration practically impossible. Might I be missing a calibration function? Attaching screenshots below.

The problem is manifest even on browser windows of identical sizes on the same screen. There seems to be a fundamental problem with coordinate translation.

Screen Shot 2020-06-19 at 11 24 04 PM

Screen Shot 2020-06-19 at 11 24 39 PM

yrammos commented 4 years ago

I was able to reproduce the issue by zooming in/out on either participant's client, so that the two zoom levels differ.

As a corollary, the issue is also reproducible with "zones" in "presentation mode."

MishkinBerteig commented 4 years ago

@yrammos I'm working on this one starting a bit this weekend.

MishkinBerteig commented 4 years ago

@yrammos I found where the problem is in the code, but fixing it might take a while longer; the part of the code involved seems to involve the code automatically creating code which is then emitted to the web browser... it's "obscure" as to how it all works exactly. I'm going to try to make some progress this week.

@mntmn Is there any way I can get a bit of help on how Spacedeck is using the Vue component and the related Vue directives that have been created? I'd be willing to do a short Zoom call sometime this weekend or this week if you have some time.

I'll struggle through regardless...

yrammos commented 4 years ago

@MishkinBerteig many thanks for your contribution. You're certainly way ahead in this, but feel free to share any preliminary findings or code chunks if you wish.

MishkinBerteig commented 4 years ago

Update: I've "fixed" the problem, but it turns out there are a bunch of dependencies that I have to track down to adjust for the fix. Basically, in public/javascripts/spacedeck_whiteboard.js there is a function called cursor_point_to_space that takes window coordinates from a mouse event and converts them into coordinates on the whiteboard. That function was calculating the conversion incorrectly... but the function is used by a whole bunch of other functions that depended on the incorrect functionality. So, I'm cleaning that up. Hopefully not long now...

MishkinBerteig commented 4 years ago

@yrammos I couldn't duplicate the kind of extreme problem you illustrate above... But I've submitted a pull request that hopefully fixes the coordinate translation problems.

yrammos commented 4 years ago

@MishkinBerteig thank you! I will be testing your revision for the next few days, reporting any issues on the PR page.

yrammos commented 4 years ago

@MishkinBerteig congratulations! This seems to be working well so far, with no side-effects. I'll continue to test, also under more adverse conditions (different monitor sizes). At the outset, though, the coordinates now seem flawlessly translated when zooming in and out.

MishkinBerteig commented 4 years ago

@yrammos Just added another small change to the PR that fixes a regression I introduced into the panning behaviour. I recommend seeing if the latest update still works for your uses.

yrammos commented 4 years ago

@MishkinBerteig as I just reported on the PR page, it's looking good. Thanks!

mntmn commented 4 years ago

Fixed by dccf0465b388b34c63a9fb20f3b9d11ceeece356