Skip to content

Commit

Permalink
Ticket #4: fixed "flickering" effect when resizing window
Browse files Browse the repository at this point in the history
  • Loading branch information
obiot committed Oct 25, 2012
1 parent df7a096 commit 29dc817
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/video/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,10 @@
var scale = max_height / me.video.getHeight();

// update the "front" canvas size
me.video.updateDisplaySize(scale,scale);
me.video.updateDisplaySize.defer(scale,scale);
} else {
// scale the display canvas to fit with the parent container
me.video.updateDisplaySize(
me.video.updateDisplaySize.defer(
max_width / me.video.getWidth(),
max_height / me.video.getHeight()
);
Expand All @@ -407,6 +407,9 @@
// apply the new value
canvas.width = game_width_zoom = backBufferCanvas.width * scaleX;
canvas.height = game_height_zoom = backBufferCanvas.height * scaleY;

// force a canvas repaint
api.blitSurface();
};

/**
Expand Down

0 comments on commit 29dc817

Please sign in to comment.