浏览代码

Merge b5c29352ed into 1eaccef60f

pull/1195/merge
Malgalad 1 个月前
committed by GitHub
父节点
当前提交
d0bc6e38df
找不到此签名对应的密钥 GPG 密钥 ID: B5690EEEBB952194
共有 2 个文件被更改,包括 9 次插入0 次删除
  1. +5
    -0
      doc/json-config-parameters.md
  2. +4
    -0
      src/js/pannellum.js

+ 5
- 0
doc/json-config-parameters.md 查看文件

@@ -361,6 +361,11 @@ Defaults to `false`.

Applies a fixed scaling to the default hot spot size. Can be combined with `scale`.

#### `sticky` (boolean)

When `true`, the hot spot will stick to the edges of the screen, always visible.
Defaults to `false`.

### `hotSpotDebug` (boolean)

When `true`, the mouse pointer's pitch and yaw are logged to the console when


+ 4
- 0
src/js/pannellum.js 查看文件

@@ -2078,6 +2078,10 @@ function renderHotSpot(hs) {
// Apply transform
coord[0] += (canvasWidth - hs.div.offsetWidth) / 2;
coord[1] += (canvasHeight - hs.div.offsetHeight) / 2;
if (hs.sticky) {
coord[0] = Math.min(canvasWidth - hs.div.offsetWidth, Math.max(0, coord[0]));
coord[1] = Math.min(canvasHeight - hs.div.offsetHeight, Math.max(0, coord[1]));
}
var transform = 'translate(' + coord[0] + 'px, ' + coord[1] +
'px) translateZ(9999px) rotate(' + config.roll + 'deg)';
if (hs.scale)


正在加载...
取消
保存