Skip to content

Commit

Permalink
Fix letterbox scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
Anheurystics committed Jun 15, 2018
1 parent cd2447c commit 07d0564
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions haxepunk/screen/UniformScaleMode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ class UniformScaleMode extends ScaleMode
{
case Letterbox:
// fill only part of the window
HXP.screen.width = Std.int(baseWidth * scale);
HXP.screen.height = Std.int(baseHeight * scale);
HXP.screen.x = Std.int((stageWidth - HXP.screen.width) / 2);
HXP.screen.y = Std.int((stageHeight - HXP.screen.height) / 2);
// TODO: Add toggleable black bars
HXP.screen.x = Std.int((stageWidth - Std.int(baseWidth * scale)) / 2);
HXP.screen.y = Std.int((stageHeight - Std.int(baseHeight * scale)) / 2);
HXP.screen.width = stageWidth;
HXP.screen.height = stageHeight;
case Expand, ZoomIn:
// fill the window
HXP.screen.x = HXP.screen.y = 0;
Expand Down

0 comments on commit 07d0564

Please sign in to comment.