Skip to content

Commit 295a816

Browse files
authored
Merge pull request #98 from matthewturk/loosen_private_methods
Change getCoordinates and resizeCanvas to protected
2 parents 054deac + 6ae8335 commit 295a816

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/widget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ class CanvasView extends DOMWidgetView {
360360
this.ctx.drawImage(this.model.canvas, 0, 0);
361361
}
362362

363-
private resizeCanvas() {
363+
protected resizeCanvas() {
364364
this.canvas.setAttribute('width', this.model.get('width'));
365365
this.canvas.setAttribute('height', this.model.get('height'));
366366
}
@@ -401,7 +401,7 @@ class CanvasView extends DOMWidgetView {
401401
this.model.send({ event: 'touch_cancel', touches: touches.map(this.getCoordinates.bind(this)) }, {});
402402
}
403403

404-
private getCoordinates(event: MouseEvent | Touch) {
404+
protected getCoordinates(event: MouseEvent | Touch) {
405405
const rect = this.canvas.getBoundingClientRect();
406406
const x = event.clientX - rect.left;
407407
const y = event.clientY - rect.top;

0 commit comments

Comments
 (0)