Skip to content

Commit

Permalink
Canvas: Calculate height based on command presence anyway.
Browse files Browse the repository at this point in the history
zb3 left some comments stating that games check this before adding
any commands. But from what i've seen on this source, calculating
height based on commands instead of being fullscreen or not makes
games that do use commands scale better. Case in point, Crash
Bandicoot and City Race, although Munkiki's Castles is also improved
by not starting with a small white bar at the bottom.
  • Loading branch information
AShiningRay committed Dec 16, 2024
1 parent 1b98110 commit 7aeb021
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/javax/microedition/lcdui/Canvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,7 @@ protected void sizeChanged(int w, int h)
public void notifySetCurrent() { _invalidate(); }

@Override
public int getHeight()
{
/*
* zb3: this is quite problematic because games check this before adding commands
* so if we'd only include the bar if there are commands, games could
* get invalid resolution
*/
return fullscreen ? height : height - barHeight;
}
public int getHeight() { return commands.isEmpty() ? height : height - barHeight; }

private void paintCommandsBar()
{
Expand Down

0 comments on commit 7aeb021

Please sign in to comment.