uses only canvas object, renames it to avoid future problems

This commit is contained in:
Francisco Dans 2015-02-24 12:08:11 +01:00
parent 4b240a4485
commit 169de36bcf

View File

@ -4,8 +4,8 @@
// developed by Francisco Dans // developed by Francisco Dans
//////////////////////////////// ////////////////////////////////
function BallRenderer(canvas){ function BallRenderer(thecanvas){
this.canvas = typeof canvas === "string"? document.getElementById(canvas) : canvas; this.canvas = thecanvas;
this.ctx = this.canvas.getContext("2d"); this.ctx = this.canvas.getContext("2d");
this.width = this.canvas.width; this.width = this.canvas.width;
this.height = this.canvas.height; this.height = this.canvas.height;