Rich2 / openstrat

Cross Platform Scala 2d graphics (but 3d compatible), basic geometry, maps, Earth maps, hex-tiling and strategy library(s).
https://richstrat.com
Apache License 2.0
22 stars 8 forks source link

Web canvas breaks down when bigger than the device/browser max size #112

Closed w0d closed 4 years ago

w0d commented 4 years ago

when the canvas dimensions are set to larger than supported by the device/browser, various bad things happen

set the width / height to something large such as 3840x2160

either the browser can fall over, clip any drawing outside its max dimension, scale the canvas to fit given dimension or other weird stuff such as in this screen shot from a 4K monitor FlagsBar the scrolbar is placed incorrectly and when the flags are scrolled the viewport changes position rather than the flags

this is more of an issue with 4K HD monitors but possibly also for high pixel density devices

this will not be a straight forward fix as canvas vendors (browsers) do not expose the limits at runtime

here's some reference materials Spec: 2.2 & 2.3 Docs: Maximum canvas size Stackoverflow: Maximum size of a element GitHub: canvas-size

w0d commented 4 years ago

the screenshot above may be misleading - will update further on investigation

w0d commented 4 years ago

the bug reported was actually caused by a unrelated temporary local setup issue whilst the issue with web canvas having a maximum size and openstrat not having a way to negotiate this is still theoretically possible - im closing this issue until it can be reproduced