mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
js: Move much of the handling of device pixel ratios to the mid-end
Now that the mid-end knows how to do it, we can remove some complexity from the front end.
This commit is contained in:
16
emcclib.js
16
emcclib.js
@ -558,22 +558,6 @@ mergeInto(LibraryManager.library, {
|
||||
offscreen_canvas.height = h;
|
||||
},
|
||||
|
||||
/*
|
||||
* void js_canvas_set_nominal_size();
|
||||
*
|
||||
* Set the nominal size of the puzzle to the current canvas size
|
||||
* scaled to CSS pixels. This should be called whenever the
|
||||
* canvas size is changed other than in response to a change of
|
||||
* device pixel ratio. This nominal size will then be used at
|
||||
* every change of device pixel ratio to calculate the new
|
||||
* physical size of the canvas.
|
||||
*/
|
||||
js_canvas_set_nominal_size: function() {
|
||||
var dpr = window.devicePixelRatio || 1;
|
||||
nominal_width = onscreen_canvas.width / dpr;
|
||||
nominal_height = onscreen_canvas.height / dpr;
|
||||
},
|
||||
|
||||
/*
|
||||
* double js_get_device_pixel_ratio();
|
||||
*
|
||||
|
Reference in New Issue
Block a user