Replace hand-rolled spatial canvas drag with Konva

The custom pointer-capture + frozen-camera drag math was fragile and
felt worse than before. Konva handles the drag gesture itself; the
"me" node's screen position stays pinned to the stage center via
dragBoundFunc + a worldLayer offset that recenters on every dragmove,
so the world pans under the avatar instead of the avatar drifting off
center. Grid, peers, and the audible-range circle all live in the same
world-space layer so they pan together.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
matsandClaude Sonnet 5 committed 2026-09-22 11:14:32 +02:00
1 parent 5ecf415f64
commit 099d637815
4 files changed
+152 -109

No files matched your search

+33
View File
@@ -16,6 +16,7 @@
"@opentelemetry/sdk-logs": "^0.222.0",
"@opentelemetry/sdk-node": "^0.222.0",
"@opentelemetry/semantic-conventions": "^1.43.0",
"konva": "^10.6.0",
"matrix-js-sdk": "^42.4.0",
"ws": "^8.18.0"
},
@@ -3940,6 +3941,38 @@
"bignumber.js": "^9.0.0"
}
},
"node_modules/konva": {
"version": "10.6.0",
"resolved": "https://registry.npmjs.org/konva/-/konva-10.6.0.tgz",
"integrity": "sha512-6dyI91lZTx2mDu9DRo5zrT2Pg+Q3TFeyLfGQSAPJMhfvKjelbjPnTJimYQISam/EW+g0+pjLk/yztJKpSuxFPQ==",
"funding": [
{
"type": "patreon",
"url": "https://www.patreon.com/lavrton"
},
{
"type": "opencollective",
"url": "https://opencollective.com/konva"
},
{
"type": "github",
"url": "https://github.com/sponsors/lavrton"
}
],
"license": "MIT",
"peerDependencies": {
"canvas": "^3.0.0",
"skia-canvas": "^3.0.0"
},
"peerDependenciesMeta": {
"canvas": {
"optional": true
},
"skia-canvas": {
"optional": true
}
}
},
"node_modules/lightningcss": {
"version": "1.33.0",
"resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz",