Kaynağa Gözat

Respect z-order when rendering to the canvas

tags/v0.1.0
Fen Dweller 5 yıl önce
ebeveyn
işleme
fe160efc19
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. +5
    -1
      macrovision.js

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

@@ -2278,7 +2278,11 @@ function importScene(data) {

function renderToCanvas() {
const ctx = document.querySelector("#display").getContext("2d");
Object.entries(entities).forEach(([id, entity]) => {
Object.entries(entities).sort((ent1, ent2) => {
z1 = document.querySelector("#entity-" + ent1[0]).style.zIndex;
z2 = document.querySelector("#entity-" + ent2[0]).style.zIndex;
return z1 - z2;
}).forEach(([id, entity]) => {
element = document.querySelector("#entity-" + id);
img = element.querySelector("img");



Yükleniyor…
İptal
Kaydet