From fa58dd85b7ee06fed8d7a5ecc14fda8146f7521b Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 27 Oct 2022 14:30:23 +0100 Subject: js: Distinguish manual resizes from device pixel ratio changes This adds a new callback, rescale_puzzle(), that's called when the device pixel ratio changes. This means that resize_puzzle() can safely set the nominal canvas size, which means that manual resizing of the puzzle now sticks. Still missing: paying attention to the device pixel ratio when choosing the initial (or reset) size. --- cmake/platforms/emscripten.cmake | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cmake') diff --git a/cmake/platforms/emscripten.cmake b/cmake/platforms/emscripten.cmake index 6526037..5c13f90 100644 --- a/cmake/platforms/emscripten.cmake +++ b/cmake/platforms/emscripten.cmake @@ -26,6 +26,8 @@ set(emcc_export_list # Callbacks when the resizing controls are used _resize_puzzle _restore_puzzle_size + # Callback when device pixel ratio changes + _rescale_puzzle # Main program, run at initialisation time _main) -- cgit v1.1