Kaynağa Gözat

Fix positioning of bottom name tags

tags/v0.0.1
Fen Dweller 5 yıl önce
ebeveyn
işleme
63ad1594ed
2 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  1. +1
    -1
      macrovision.css
  2. +2
    -1
      macrovision.js

+ 1
- 1
macrovision.css Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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;
}


Yükleniyor…
İptal
Kaydet