asny / three-d

2D/3D renderer - makes it simple to draw stuff across platforms (including web)
MIT License
1.24k stars 105 forks source link

On web, use `max_size` as the canvas size #340

Closed silverlyra closed 1 year ago

silverlyra commented 1 year ago

This is the minimal change I could figure out to make (other than completely deleting the set_inner_size calls) which lets me set a specific canvas size, and have the canvas not cover the entire browser window.

I ended up adding size to SurfaceSettings, as that’s the only type available both during Window setup and WindowedContext setup. I don‘t think this is a great API change by any means; just a concrete starting point.

Closes #339.