function Blackboard(canvas){
this.socket = io.connect('http://'+window.location.host+'/blackboard');
this.canvas = canvas;
this.ctx = this.canvas[0].getContext("2d");
this.ctxServer = this.canvas[0].getContext("2d");
this.drawing = false;
this.color = 'white';
this.width = 1;
this.colorServer = 'white';
this.widthServer = 1;
this.setEvent();
this.setServerEvent();
this.setShape();
this.color_map.forEach(element => {
$("#pen_color").append($("<option>").attr('value', element).text(element));
});
Array(16).fill(0).forEach((element, index) => {
$("#pen_width").append($("<option>").attr('value', index+1).text(index+1));
});
}


this때문에 존나할맛안나는데 다른방법없음?


그리고 canvas context 두개 따로 못만듬? 저거 this.ctx===this.ctxServer 하니 true쳐나오던데