mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-14 04:01:48 +00:00
Support hidpi.
This commit is contained in:
parent
4b5a823d39
commit
cf61fbf7ba
@ -91,7 +91,9 @@
|
|||||||
var canvasElement = document.getElementById('canvas');
|
var canvasElement = document.getElementById('canvas');
|
||||||
|
|
||||||
function resizeHandler() {
|
function resizeHandler() {
|
||||||
Module.ccall('nativeResize', 'number', ['number', 'number'], [window.innerWidth, window.innerHeight]);
|
Module.ccall('nativeResize', 'number', ['number', 'number'], [window.innerWidth * window.devicePixelRatio, window.innerHeight * window.devicePixelRatio]);
|
||||||
|
Module.canvas.style.width = window.innerWidth + 'px';
|
||||||
|
Module.canvas.style.height = window.innerHeight + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
var Module = {
|
var Module = {
|
||||||
|
@ -187,7 +187,9 @@ void Backend::SetTitle( const char* title )
|
|||||||
|
|
||||||
float Backend::GetDpiScale()
|
float Backend::GetDpiScale()
|
||||||
{
|
{
|
||||||
#if GLFW_VERSION_MAJOR > 3 || ( GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 3 )
|
#ifdef __EMSCRIPTEN__
|
||||||
|
return EM_ASM_DOUBLE( { return window.devicePixelRatio; } );
|
||||||
|
#elif GLFW_VERSION_MAJOR > 3 || ( GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 3 )
|
||||||
auto monitor = glfwGetWindowMonitor( s_window );
|
auto monitor = glfwGetWindowMonitor( s_window );
|
||||||
if( !monitor ) monitor = glfwGetPrimaryMonitor();
|
if( !monitor ) monitor = glfwGetPrimaryMonitor();
|
||||||
if( monitor )
|
if( monitor )
|
||||||
|
Loading…
Reference in New Issue
Block a user