binji / binjgb

Gameboy emulator implemented in C, that also runs in the browser
https://binji.github.io/binjgb/
MIT License
534 stars 61 forks source link

Fix web demo buttons #19

Closed qguv closed 3 years ago

qguv commented 5 years ago

In the web version of the emulator, the buttons at the bottom become too wide when the FPS goes into the triple-digits, or when the pause button is replaced by a resume button.

screenshot demonstrating the too-long bar

This PR truncates FPS under 1000 to three sigfigs, and rounds FPS over 1000 to the nearest integer. It also slightly increases the bar width to account for the resume button.

binji commented 5 years ago

Interesting, I don't ever see the buttons get that close to the FPS:

Chrome: binjgb-chrome

Firefox: binjgb-ff