fix: remote pointers not accounting for offset (#2855)

This commit is contained in:
David Luzar 2021-01-25 10:47:48 +01:00 committed by GitHub
parent 0a0be839b9
commit e75f5f20e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -24,6 +24,10 @@ Please add the latest change on the top under the correct section.
- Support `Ctrl-Y` shortcut to redo on Windows [#2831](https://github.com/excalidraw/excalidraw/pull/2831).
### Fixes
- Fix remote pointers not accounting for offset [#2855](https://github.com/excalidraw/excalidraw/pull/2855).
## 0.2.1
## Excalidraw API

View File

@ -418,7 +418,9 @@ export const renderScene = (
// Paint remote pointers
for (const clientId in sceneState.remotePointerViewportCoords) {
let { x, y } = sceneState.remotePointerViewportCoords[clientId];
const username = sceneState.remotePointerUsernames[clientId];
x -= appState.offsetLeft;
y -= appState.offsetTop;
const width = 9;
const height = 14;
@ -473,6 +475,8 @@ export const renderScene = (
context.fill();
context.stroke();
const username = sceneState.remotePointerUsernames[clientId];
if (!isOutOfBounds && username) {
const offsetX = x + width;
const offsetY = y + height;