empty textCointainer on rezize so we don't have double text elements
This commit is contained in:
parent
03c7e0c670
commit
d80b18282d
@ -118,11 +118,12 @@ const whiteboard = {
|
|||||||
this.oldGCO = this.ctx.globalCompositeOperation;
|
this.oldGCO = this.ctx.globalCompositeOperation;
|
||||||
|
|
||||||
window.addEventListener("resize", function () {
|
window.addEventListener("resize", function () {
|
||||||
// Handel resize
|
// Handle resize
|
||||||
const dbCp = JSON.parse(JSON.stringify(_this.drawBuffer)); // Copy the buffer
|
const dbCp = JSON.parse(JSON.stringify(_this.drawBuffer)); // Copy the buffer
|
||||||
_this.canvas.width = $(window).width();
|
_this.canvas.width = $(window).width();
|
||||||
_this.canvas.height = $(window).height(); // Set new canvas height
|
_this.canvas.height = $(window).height(); // Set new canvas height
|
||||||
_this.drawBuffer = [];
|
_this.drawBuffer = [];
|
||||||
|
_this.textContainer.empty();
|
||||||
_this.loadData(dbCp); // draw old content in
|
_this.loadData(dbCp); // draw old content in
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user