class
ViewportEventViewport event.
Constructors, destructors, conversion operators
- ViewportEvent(const ViewportEvent&) deleted
- Copying is not allowed.
- ViewportEvent(ViewportEvent&&) deleted
- Moving is not allowed.
Public functions
- auto operator=(const ViewportEvent&) -> ViewportEvent& deleted
- Copying is not allowed.
- auto operator=(ViewportEvent&&) -> ViewportEvent& deleted
- Moving is not allowed.
- auto windowSize() const -> Vector2i
- Canvas size.
- auto framebufferSize() const -> Vector2i
- Framebuffer size.
- auto dpiScaling() const -> Vector2
- DPI scaling.
- auto devicePixelRatio() const -> Vector2
- Device pixel ratio.
- auto event() const -> const EmscriptenUiEvent*
- Underlying Emscripten event.
Function documentation
Vector2i Magnum:: Platform:: EmscriptenApplication:: ViewportEvent:: windowSize() const
Canvas size.
On HiDPI displays, window size can be different from framebufferSize(). See DPI awareness for more information. Note that this method is named "window size" to be API-compatible with Application implementations on other platforms.
Vector2i Magnum:: Platform:: EmscriptenApplication:: ViewportEvent:: framebufferSize() const
Framebuffer size.
On HiDPI displays, framebuffer size can be different from windowSize(). See DPI awareness for more information.
Vector2 Magnum:: Platform:: EmscriptenApplication:: ViewportEvent:: dpiScaling() const
DPI scaling.
On some platforms moving a browser window between displays can result in DPI scaling value being changed in tandem with a canvas/framebuffer size. Simply resizing the canvas doesn't change the DPI scaling value. See DPI awareness for more information.
Vector2 Magnum:: Platform:: EmscriptenApplication:: ViewportEvent:: devicePixelRatio() const
Device pixel ratio.
On some platforms moving a browser window between displays can result in device pixel ratio value being changed. Crossplatform code shouldn't need to query this value because the ratio is already expressed in the ratio of windowSize() and framebufferSize() values. See DPI awareness for more information.
const EmscriptenUiEvent* Magnum:: Platform:: EmscriptenApplication:: ViewportEvent:: event() const
Underlying Emscripten event.
If the viewport event doesn't come from a browser event (for example when the canvas was resized programatically and not as a consequence of window size change), the function returns nullptr
.