mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.23k stars 721 forks source link

Add "sticky" option to hot spots #1195

Open Malgalad opened 9 months ago

Malgalad commented 9 months ago

A barebones proposal to cover #1193. If hot spot has a new option sticky set to truthy value, then hot spot coordinates are clamped to always be within canvas space.

It seems to be working for me and does cover the basic functionality, but I am open to updates if it requires more configuration or logic. E.g. more padding, pointing arrows, not dispatching events unless hot spot should be visible without clamping, maybe some crowding logic so multiple hot spots don't collapse into one in a corner...

mpetroff commented 8 months ago

This implementation is flawed. It doesn't handle hot spots that are >90 deg from the center of the view, and the vertical position of these indicators should not move when panning only in yaw. Furthermore, there would need to be some sort of visual indicator that these hot spots are actually off the edge of the screen.