Переглянути джерело

Fix rulers causing errors when their entity is deleted

master
Fen Dweller 3 роки тому
джерело
коміт
dcfd494355
1 змінених файлів з 10 додано та 0 видалено
  1. +10
    -0
      macrovision.js

+ 10
- 0
macrovision.js Переглянути файл

@@ -980,7 +980,17 @@ function updateSizes(dirtyOnly = false) {
drawRulers();
}

function cleanRulers() {
rulers = rulers.filter(ruler => {
if (!ruler.entityKey) {
return true;
} else {
return entities[ruler.entityKey] !== undefined;
}
});
}
function drawRulers() {
cleanRulers();
const canvas = document.querySelector("#rulers");

/** @type {CanvasRenderingContext2D} */


Завантаження…
Відмінити
Зберегти