Skip to content

Commit

Permalink
Merge pull request CleverRaven#71436 from nornagon/emscripten-hidpi
Browse files Browse the repository at this point in the history
fix wrong scaling on hidpi screens in emscripten
  • Loading branch information
akrieger authored and nornagon committed Jun 7, 2024
1 parent 87cf016 commit 81cea25
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ static void WinCreate()
window_flags |= SDL_WINDOW_MAXIMIZED;
}
#endif
#if defined(EMSCRIPTEN)
// Without this, the game only displays in the top-left 1/4 of the window.
window_flags &= ~SDL_WINDOW_ALLOW_HIGHDPI;
#endif

int display = std::stoi( get_option<std::string>( "DISPLAY" ) );
if( display < 0 || display >= SDL_GetNumVideoDisplays() ) {
Expand Down

0 comments on commit 81cea25

Please sign in to comment.