mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-27 09:50:52 -05:00
use actual canvas size for default render bounds
This commit is contained in:
parent
2510cdfa12
commit
c3129b8651
1 changed files with 4 additions and 3 deletions
|
@ -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 = {};
|
||||
|
@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue