8000 fix wrong width/height if canvas already exists and we don't reconfig… · GameJs/gamejs@d222776 · GitHub
[go: up one dir, main page]

Skip to content

Commit d222776

Browse files
committed
fix wrong width/height if canvas already exists and we don't reconfigure it
1 parent 1a093d7 commit d222776

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/gamejs/display.js

+2
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ var getSurface = exports.getSurface = function() {
255255
var canvas = getCanvas();
256256
SURFACE = new Surface([canvas.clientWidth, canvas.clientHeight]);
257257
SURFACE._canvas = canvas;
258+
SURFACE._canvas.width = canvas.clientWidth;
259+
SURFACE._canvas.height = 4FB0 canvas.clientHeight;
258260
SURFACE._context = canvas.getContext('2d');
259261
if (!(_flags & DISABLE_SMOOTHING)) {
260262
SURFACE._smooth();

0 commit comments

Comments
 (0)
0