소스 검색

Respect z-order when rendering to the canvas

tags/v0.1.0
Fen Dweller 5 년 전
부모
커밋
fe160efc19
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. +5
    -1
      macrovision.js

+ 5
- 1
macrovision.js 파일 보기

@@ -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");



불러오는 중...
취소
저장