Skip to content

Commit

Permalink
Allow overriding canvas width/height with options
Browse files Browse the repository at this point in the history
  • Loading branch information
pa7 committed Jan 6, 2013
1 parent 2219e9e commit 8ef4c53
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,13 @@

},
resize: function () {
var element = this.get("element"),
canvas = this.get("canvas"),
acanvas = this.get("acanvas");
canvas.width = acanvas.width = element.style.width.replace(/px/, "") || this.getWidth(element);
var me = this,
element = me.get("element"),
canvas = me.get("canvas"),
acanvas = me.get("acanvas");
canvas.width = acanvas.width = me.get("width") || element.style.width.replace(/px/, "") || me.getWidth(element);
this.set("width", canvas.width);
canvas.height = acanvas.height = element.style.height.replace(/px/, "") || this.getHeight(element);
canvas.height = acanvas.height = me.get("height") || element.style.height.replace(/px/, "") || me.getHeight(element);
this.set("height", canvas.height);
},

Expand Down

0 comments on commit 8ef4c53

Please sign in to comment.