feat: added clear page button

This commit is contained in:
Bruno
2024-07-25 22:25:46 -03:00
parent 969fbe83c7
commit c551089c1c
2 changed files with 10 additions and 0 deletions

View File

@@ -211,6 +211,7 @@
style="text-align: center"
/>
<button onclick="repeatImage();" class="input">Add Images</button>
<button onclick="clearSheet();" class="input">Reset Page</button>
</div>
</div>
<div class="center">

View File

@@ -160,6 +160,15 @@ function drawSheetReal() {
}
}
function clearSheet() {
const canvas = document.querySelector("canvas");
const context = canvas.getContext("2d");
context.clearRect(0, 0, canvas.width, canvas.height);
imageList = [];
}
function downloadCanvas() {
var download = document.createElement("a");
download.download = "print.png";