Skip to main content

Viewport

Function Viewport 

Source
pub fn Viewport(props: ViewportProps) -> impl IntoView
Expand description

A render surface backed by a web worker. On mount it sizes a canvas to the device pixel ratio, transfers it to an OffscreenCanvas, spawns the module worker at worker_url, and reports the Bridge, canvas, and dimensions through on_connect. It forwards pointer, wheel, touch, and resize events as ViewportEvents to on_input, worker messages to on_message, failures to the optional on_error, and toggles the grabbing signal during pointer interaction.

§Required Props

§Optional Props