diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2022-10-29 21:45:11 +0100 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2022-12-10 18:33:00 +0000 |
| commit | 33b5c484295657678ea22db3d57fd19cda96a45e (patch) | |
| tree | dce3896f56cbc60d6b3cd30a17028e2639c76f1b /emcclib.js | |
| parent | 14eb35da4aa8a66a05012af9860a7088dbf21c6d (diff) | |
| download | puzzles-33b5c484295657678ea22db3d57fd19cda96a45e.zip puzzles-33b5c484295657678ea22db3d57fd19cda96a45e.tar.gz puzzles-33b5c484295657678ea22db3d57fd19cda96a45e.tar.bz2 puzzles-33b5c484295657678ea22db3d57fd19cda96a45e.tar.xz | |
js: Add a new function whereby C can ask JS for a preferred board size
Currently JS has no opinion.
Diffstat (limited to 'emcclib.js')
| -rw-r--r-- | emcclib.js | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -564,6 +564,20 @@ mergeInto(LibraryManager.library, { }, /* + * bool js_canvas_get_preferred_size(int *wp, int *hp); + * + * This is called before calling midend_size() to set a puzzle to + * the default size. If the JavaScript layer has an opinion about + * how big the puzzle should be, it can overwrite *wp and *hp with + * its preferred size, and return true if the "user" parameter to + * midend_size() should be true. Otherwise it should leave them + * alone and return false. + */ + js_canvas_get_preferred_size: function(wp, hp) { + return false; + }, + + /* * void js_canvas_set_size(int w, int h); * * Set the size of the puzzle canvas. Called whenever the size of |