empty textCointainer on rezize so we don't have double text elements

This commit is contained in:
raphael 2021-05-20 17:16:02 +02:00
parent 03c7e0c670
commit d80b18282d

View File

@ -118,11 +118,12 @@ const whiteboard = {
this.oldGCO = this.ctx.globalCompositeOperation;
window.addEventListener("resize", function () {
// Handel resize
// Handle resize
const dbCp = JSON.parse(JSON.stringify(_this.drawBuffer)); // Copy the buffer
_this.canvas.width = $(window).width();
_this.canvas.height = $(window).height(); // Set new canvas height
_this.drawBuffer = [];
_this.textContainer.empty();
_this.loadData(dbCp); // draw old content in
});