simon-git: puzzles (main): Ben Harris
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Thu Oct 27 22:58:53 BST 2022
TL;DR:
5af0cd4 js: Add a CMake variable to control whether Emscripten emits WASM
532d662 js: Very bad attempt at making puzzles change size when zooming
9783bbf js: Split setting nominal and actual canvas size
fa58dd8 js: Distinguish manual resizes from device pixel ratio changes
1e8169e js: Take device pixel ratio into account when setting default size
Repository: https://git.tartarus.org/simon/puzzles.git
On the web: https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer: Ben Harris <bjh21 at bjh21.me.uk>
Date: 2022-10-27 22:58:53
commit 5af0cd4ac1f906fb09e0bf1cac967c1c27dc240f
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=5af0cd4ac1f906fb09e0bf1cac967c1c27dc240f;hp=6f5debe417dbcb4b17be00fa4790b80ed887158c
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Wed Oct 26 22:49:36 2022 +0100
js: Add a CMake variable to control whether Emscripten emits WASM
I've finally got bored of keeping (and occasionally losing) a patch
that turns it off unconditionally.
cmake/platforms/emscripten.cmake | 8 ++++++++
1 file changed, 8 insertions(+)
commit 532d662722da1fa8cce211ced79da575059d359c
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=532d662722da1fa8cce211ced79da575059d359c;hp=5af0cd4ac1f906fb09e0bf1cac967c1c27dc240f
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Thu Oct 27 10:12:54 2022 +0100
js: Very bad attempt at making puzzles change size when zooming
This has the entertaining consequence that repeatedly zooming in and out
causes puzzles to gradually shrink, thus demonstrating that recording
the nominal size correctly will be necessary.
emcclib.js | 5 ++++-
emccpre.js | 10 ++++++++--
2 files changed, 12 insertions(+), 3 deletions(-)
commit 9783bbfbc01f2faff86daaa53e46bf68848b8b7c
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=9783bbfbc01f2faff86daaa53e46bf68848b8b7c;hp=532d662722da1fa8cce211ced79da575059d359c
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Thu Oct 27 11:27:22 2022 +0100
js: Split setting nominal and actual canvas size
Now zooming in and out repeatedly doesn't cause the canvas to wither
away, but user resizes don't stick any more. Still more to do.
emcc.c | 2 ++
emcclib.js | 28 +++++++++++++++++++++-------
2 files changed, 23 insertions(+), 7 deletions(-)
commit fa58dd85b7ee06fed8d7a5ecc14fda8146f7521b
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=fa58dd85b7ee06fed8d7a5ecc14fda8146f7521b;hp=9783bbfbc01f2faff86daaa53e46bf68848b8b7c
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Thu Oct 27 14:30:23 2022 +0100
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 ++
emcc.c | 11 +++++++++--
emccpre.js | 4 +++-
3 files changed, 14 insertions(+), 3 deletions(-)
commit 1e8169ea94da3c37fc8fbe38ccb8120ae540743a
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=1e8169ea94da3c37fc8fbe38ccb8120ae540743a;hp=fa58dd85b7ee06fed8d7a5ecc14fda8146f7521b
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Thu Oct 27 22:37:31 2022 +0100
js: Take device pixel ratio into account when setting default size
This is a bit of a hack. When setting the puzzle to its default size,
either at startup or from a right-click on the resize handle, we now
scale the default size from midend_size() by the device pixel ratio,
and then pass that back to midend_size(). This does more or less the
right thing, in that the puzzle now starts up at a size that scales
with the font size.
There are still some slight inconsistencies, where sequences of DPR
changes and puzzle parameter changes can have order-dependent effects
on the size of the puzzle. Happily these effects are small and fairly
hard to observe.
emcc.c | 35 ++++++++++++++++++++++++++++-------
emcclib.js | 9 +++++++++
2 files changed, 37 insertions(+), 7 deletions(-)
More information about the tartarus-commits
mailing list