浏览代码

Fix positioning of bottom name tags

tags/v0.0.1
Fen Dweller 5 年前
父节点
当前提交
63ad1594ed
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. +1
    -1
      macrovision.css
  2. +2
    -1
      macrovision.js

+ 1
- 1
macrovision.css 查看文件

@@ -171,5 +171,5 @@ body #test-canvas {
position: fixed;
width: 75px;
height: 50px;
transform: translate(125%, 0%);
transform: translate(-50%, 0%);
}

+ 2
- 1
macrovision.js 查看文件

@@ -75,7 +75,8 @@ function updateEntityElement(entity, element) {

const bottomName = document.querySelector("#bottom-name-" + element.dataset.key);

bottomName.style.left = position.x + "px";
let entX = document.querySelector("#entities").getBoundingClientRect().x;
bottomName.style.left = position.x + entX + "px";
bottomName.style.top = "95vh";
bottomName.innerText = entity.name;
}


正在加载...
取消
保存