Skip to content

Commit

Permalink
use actual canvas size for default render bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Dec 5, 2015
1 parent 2510cdf commit c3129b8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/render/Render.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ var Vector = require('../geometry/Vector');

var render = Common.extend(defaults, options);

if(render.canvas) {
if (render.canvas) {
render.canvas.width = render.options.width || render.canvas.width;
render.canvas.height = render.options.height || render.canvas.height;
}

render.canvas = render.canvas || _createCanvas(render.options.width, render.options.height);
render.context = render.canvas.getContext('2d');
render.textures = {};
Expand All @@ -81,8 +82,8 @@ var Vector = require('../geometry/Vector');
y: 0
},
max: {
x: render.options.width,
y: render.options.height
x: render.canvas.width,
y: render.canvas.height
}
};

Expand Down

0 comments on commit c3129b8

Please sign in to comment.