chiark / gitweb /
Add a draggable resize handle to the JS puzzles.
authorSimon Tatham <anakin@pobox.com>
Sun, 7 Apr 2013 10:24:37 +0000 (10:24 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 7 Apr 2013 10:24:37 +0000 (10:24 +0000)
commitc0fff857fd910eb4af7eabd6ad08da554f694f43
treeaf11c895edb987c8595bea636b9eab94f8705269
parent9799ff0e2a607ceef544b7f89ab7ee59be0fd9bd
Add a draggable resize handle to the JS puzzles.

Rather than design an ersatz 'window frame' surrounding the puzzle
canvas, I've simply overlaid the resize handle on the corner of the
puzzle itself (canvas or status bar, depending on whether the latter
exists), trusting that all games in my collection provide a reasonable
border within their drawing area. (OS X already does this with its
resize handle, so it's not as if there's no precedent.)

Unlike the desktop versions, I control the resize behaviour completely
in this environment, so I can constrain the canvas to only ever be
sensible sizes with no dead space round the edges (and, in particular,
preserve the aspect ratio).

Right-clicking the resize handle will restore the puzzle's default
tile size. I had intended to implement a maximise-to-browser-window
button too, but was annoyingly foiled by scrollbars - if you maximise
to the current window width, and as a result the text below the puzzle
scrolls off the bottom, then a vertical scrollbar appears and eats
into the width you just maximised to. Gah.

[originally from svn r9822]
emcc.c
emcclib.js
emccpre.js
emccx.json
html/jspage.pl