fix: use picked coordinate instead of unprojecting screen coordinates when multipicking#2649
Conversation
| ); | ||
|
|
||
| const worldCoordinate = | ||
| activePickingInfo[0]?.coordinate || |
There was a problem hiding this comment.
Prefer using ?? instead of ||
There was a problem hiding this comment.
@w1nklr I am struggling to run the smoke tests locally. I assume this has to be done through the docker to reproduce the same environment? I cant get this approach to work.
npm run docker:build && npm run docker:storybook:test
...
[test-storybook] It seems that your Storybook instance is not running at: http://host.docker.internal:6006/
There was a problem hiding this comment.
Is storybook running locally?
There was a problem hiding this comment.
Maybe it doesn't resolve host.docker.internal?
Can you try:
npm run docker:storybook:test -- npm run storybook:test -- --url http://localhost:6006/ --no-index-json --updateSnapshot
There was a problem hiding this comment.
I had to run storybook with npm run storybook -- --host 0.0.0.0
Its probably because of WSL, which uses its own VM and interface. Docker runs in its own VM. Windows is the host.
I.e. they have different localhost. Binding to 0.0.0.0 opens it up to all interfaces.
There was a problem hiding this comment.
Started on a PR to run both storybook and test-runner with docker-compose: #2619
Should make it more reliable, but also some drawbacks.
There was a problem hiding this comment.
In this there was no need to run the smoke test after all. They shouldnt change.
Ready for review now.
f49d6f5 to
e0edf71
Compare
Relates to equinor/webviz#1229
The multi-picking hook used 2d screen coordinates to unproject to world coordinates.
For 3d view we need the z-value as well.
https://deck.gl/docs/api-reference/core/viewport#unproject
Fix:
Use coordinates from first picked object as reference point.
If picking outside, uses the default.