Sfoglia il codice sorgente

Fix ground rendering over entities when taking a screenshot

master
Fen Dweller 5 anni fa
parent
commit
cb5532ebd8
1 ha cambiato i file con 7 aggiunte e 6 eliminazioni
  1. +7
    -6
      macrovision.js

+ 7
- 6
macrovision.js Vedi File

@@ -3626,20 +3626,21 @@ function exportCanvas(callback) {
} }


function generateScreenshot(callback) { function generateScreenshot(callback) {
renderToCanvas();

/** @type {CanvasRenderingContext2D} */ /** @type {CanvasRenderingContext2D} */
const ctx = document.querySelector("#display").getContext("2d"); const ctx = document.querySelector("#display").getContext("2d");


ctx.fillStyle = "#555";
ctx.font = "normal normal lighter 16pt coda";
ctx.fillText("macrovision.crux.sexy", 10, 25);

if (checkBodyClass("toggle-bottom-cover")) { if (checkBodyClass("toggle-bottom-cover")) {
ctx.fillStyle = "#000"; ctx.fillStyle = "#000";
ctx.fillRect(0, pos2pix({x: 0, y: 0}).y, canvasWidth + 100, canvasHeight); ctx.fillRect(0, pos2pix({x: 0, y: 0}).y, canvasWidth + 100, canvasHeight);
} }
renderToCanvas();

ctx.fillStyle = "#555";
ctx.font = "normal normal lighter 16pt coda";
ctx.fillText("macrovision.crux.sexy", 10, 25);

exportCanvas(blob => { exportCanvas(blob => {
callback(blob); callback(blob);
}); });


Loading…
Annulla
Salva