Fix blurred web page at fractional scaling.

This commit is contained in:
Bartosz Taudul
2026-05-13 21:53:35 +02:00
parent 7e9f66c987
commit eb3df3b411

View File

@@ -299,8 +299,12 @@ void Backend::NewFrame( int& w, int& h )
if( s_width != w || s_height != h )
{
EM_ASM( Module.canvas.style.width = window.innerWidth + 'px'; Module.canvas.style.height = window.innerHeight + 'px' );
EM_ASM( Module.canvas.width = $0; Module.canvas.height = $1, w, h );
EM_ASM( {
Module.canvas.style.width = ($0 / $2) + 'px';
Module.canvas.style.height = ($1 / $2) + 'px';
Module.canvas.width = $0;
Module.canvas.height = $1;
}, w, h, double( scale ) );
s_width = w;
s_height = h;