diff --git a/Cargo.toml b/Cargo.toml index 4cace8d49..c98179f8f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,4 +36,4 @@ opt-level = 2 [workspace.dependencies] thiserror = "1.0.37" -wgpu = { version = "0.17.0", features = ["fragile-send-sync-non-atomic-wasm"] } +wgpu = "0.17.0" diff --git a/crates/egui-wgpu/src/lib.rs b/crates/egui-wgpu/src/lib.rs index 485e00af7..7d0a3506c 100644 --- a/crates/egui-wgpu/src/lib.rs +++ b/crates/egui-wgpu/src/lib.rs @@ -10,8 +10,8 @@ pub use wgpu; /// Low-level painting of [`egui`](https://github.com/emilk/egui) on [`wgpu`]. pub mod renderer; -pub use renderer::CallbackFn; pub use renderer::Renderer; +pub use renderer::{Callback, CallbackResources, CallbackTrait}; /// Module for painting [`egui`](https://github.com/emilk/egui) with [`wgpu`] on [`winit`]. #[cfg(feature = "winit")] diff --git a/crates/egui-wgpu/src/renderer.rs b/crates/egui-wgpu/src/renderer.rs index c3def5fce..94fb95307 100644 --- a/crates/egui-wgpu/src/renderer.rs +++ b/crates/egui-wgpu/src/renderer.rs @@ -1,107 +1,109 @@ #![allow(unsafe_code)] -use std::num::NonZeroU64; -use std::ops::Range; -use std::{borrow::Cow, collections::HashMap}; +use std::{borrow::Cow, num::NonZeroU64, ops::Range}; + +use epaint::{ahash::HashMap, emath::NumExt, PaintCallbackInfo, Primitive, Vertex}; -use type_map::concurrent::TypeMap; use wgpu; use wgpu::util::DeviceExt as _; -use epaint::{emath::NumExt, PaintCallbackInfo, Primitive, Vertex}; +// Only implements Send + Sync on wasm32 in order to allow storing wgpu resources on the type map. +#[cfg(not(target_arch = "wasm32"))] +pub type CallbackResources = type_map::concurrent::TypeMap; +#[cfg(target_arch = "wasm32")] +pub type CallbackResources = type_map::TypeMap; -/// A callback function that can be used to compose an [`epaint::PaintCallback`] for custom WGPU -/// rendering. -/// -/// The callback is composed of two functions: `prepare` and `paint`: -/// - `prepare` is called every frame before `paint`, and can use the passed-in -/// [`wgpu::Device`] and [`wgpu::Buffer`] to allocate or modify GPU resources such as buffers. -/// - `paint` is called after `prepare` and is given access to the [`wgpu::RenderPass`] so -/// that it can issue draw commands into the same [`wgpu::RenderPass`] that is used for -/// all other egui elements. -/// -/// The final argument of both the `prepare` and `paint` callbacks is a the -/// [`paint_callback_resources`][crate::renderer::Renderer::paint_callback_resources]. -/// `paint_callback_resources` has the same lifetime as the Egui render pass, so it can be used to -/// store buffers, pipelines, and other information that needs to be accessed during the render -/// pass. -/// -/// # Example -/// -/// See the [`custom3d_wgpu`](https://github.com/emilk/egui/blob/master/crates/egui_demo_app/src/apps/custom3d_wgpu.rs) demo source for a detailed usage example. -pub struct CallbackFn { - prepare: Box, - paint: Box, -} +pub struct Callback(Box); -type PrepareCallback = dyn Fn( - &wgpu::Device, - &wgpu::Queue, - &mut wgpu::CommandEncoder, - &mut TypeMap, - ) -> Vec - + Sync - + Send; - -type PaintCallback = - dyn for<'a, 'b> Fn(PaintCallbackInfo, &'a mut wgpu::RenderPass<'b>, &'b TypeMap) + Sync + Send; - -impl Default for CallbackFn { - fn default() -> Self { - CallbackFn { - prepare: Box::new(|_, _, _, _| Vec::new()), - paint: Box::new(|_, _, _| ()), +impl Callback { + /// Creates a new [`epaint::PaintCallback`] from a callback trait instance. + pub fn new_paint_callback( + rect: epaint::emath::Rect, + callback: impl CallbackTrait + 'static, + ) -> epaint::PaintCallback { + epaint::PaintCallback { + rect, + callback: std::sync::Arc::new(Self(Box::new(callback))), } } } -impl CallbackFn { - pub fn new() -> Self { - Self::default() +/// A callback trait that can be used to compose an [`epaint::PaintCallback`] via [`Callback`] +/// for custom WGPU rendering. +/// +/// Callbacks in [`Renderer`] are done in three steps: +/// * [`CallbackTrait::prepare`]: called for all registered callbacks before the main egui render pass. +/// * [`CallbackTrait::finish_prepare`]: called for all registered callbacks after all callbacks finished calling prepare. +/// * [`CallbackTrait::paint`]: called for all registered callbacks during the main egui render pass. +/// +/// Each callback has access to an instance of [`CallbackResources`] that is stored in the [`Renderer`]. +/// This can be used to store wgpu resources that need to be accessed during the [`CallbackTrait::paint`] step. +/// +/// The callbacks implementing [`CallbackTrait`] itself must always be Send + Sync, but resources stored in +/// [`Renderer::callback_resources`] are not required to implement Send + Sync when building for wasm. +/// (this is because wgpu stores references to the JS heap in most of its resources which can not be shared with other threads). +/// +/// +/// # Command submission +/// +/// ## Command Encoder +/// +/// The passed-in `CommandEncoder` is egui's and can be used directly to register +/// wgpu commands for simple use cases. +/// This allows reusing the same [`wgpu::CommandEncoder`] for all callbacks and egui +/// rendering itself. +/// +/// ## Command Buffers +/// +/// For more complicated use cases, one can also return a list of arbitrary +/// `CommandBuffer`s and have complete control over how they get created and fed. +/// In particular, this gives an opportunity to parallelize command registration and +/// prevents a faulty callback from poisoning the main wgpu pipeline. +/// +/// When using eframe, the main egui command buffer, as well as all user-defined +/// command buffers returned by this function, are guaranteed to all be submitted +/// at once in a single call. +/// +/// Command Buffers returned by [`CallbackTrait::finish_prepare`] will always be issued *after* +/// those returned by [`CallbackTrait::prepare`]. +/// Order within command buffers returned by [`CallbackTrait::prepare`] is dependent +/// on the order the respective [`epaint::Shape::Callback`]s were submitted in. +/// +/// # Example +/// +/// See the [`custom3d_wgpu`](https://github.com/emilk/egui/blob/master/crates/egui_demo_app/src/apps/custom3d_wgpu.rs) demo source for a detailed usage example. +pub trait CallbackTrait: Send + Sync { + fn prepare( + &self, + _device: &wgpu::Device, + _queue: &wgpu::Queue, + _egui_encoder: &mut wgpu::CommandEncoder, + _callback_resources: &mut CallbackResources, + ) -> Vec { + Vec::new() } - /// Set the prepare callback. - /// - /// The passed-in `CommandEncoder` is egui's and can be used directly to register - /// wgpu commands for simple use cases. - /// This allows reusing the same [`wgpu::CommandEncoder`] for all callbacks and egui - /// rendering itself. - /// - /// For more complicated use cases, one can also return a list of arbitrary - /// `CommandBuffer`s and have complete control over how they get created and fed. - /// In particular, this gives an opportunity to parallelize command registration and - /// prevents a faulty callback from poisoning the main wgpu pipeline. - /// - /// When using eframe, the main egui command buffer, as well as all user-defined - /// command buffers returned by this function, are guaranteed to all be submitted - /// at once in a single call. - pub fn prepare(mut self, prepare: F) -> Self - where - F: Fn( - &wgpu::Device, - &wgpu::Queue, - &mut wgpu::CommandEncoder, - &mut TypeMap, - ) -> Vec - + Sync - + Send - + 'static, - { - self.prepare = Box::new(prepare) as _; - self + /// Called after all [`CallbackTrait::prepare`] calls are done. + fn finish_prepare( + &self, + _device: &wgpu::Device, + _queue: &wgpu::Queue, + _egui_encoder: &mut wgpu::CommandEncoder, + _callback_resources: &mut CallbackResources, + ) -> Vec { + Vec::new() } - /// Set the paint callback - pub fn paint(mut self, paint: F) -> Self - where - F: for<'a, 'b> Fn(PaintCallbackInfo, &'a mut wgpu::RenderPass<'b>, &'b TypeMap) - + Sync - + Send - + 'static, - { - self.paint = Box::new(paint) as _; - self - } + /// Called after all [`CallbackTrait::finish_prepare`] calls are done. + /// + /// It is given access to the [`wgpu::RenderPass`] so that it can issue draw commands + /// into the same [`wgpu::RenderPass`] that is used for all other egui elements. + fn paint<'a>( + &'a self, + info: PaintCallbackInfo, + render_pass: &mut wgpu::RenderPass<'a>, + callback_resources: &'a CallbackResources, + ); } /// Information about the screen used for rendering. @@ -164,9 +166,10 @@ pub struct Renderer { next_user_texture_id: u64, samplers: HashMap, - /// Storage for use by [`epaint::PaintCallback`]'s that need to store resources such as render - /// pipelines that must have the lifetime of the renderpass. - pub paint_callback_resources: TypeMap, + /// Storage for resources shared with all invocations of [`CallbackTrait`]'s methods. + /// + /// See also [`CallbackTrait`]. + pub callback_resources: CallbackResources, } impl Renderer { @@ -346,10 +349,10 @@ impl Renderer { }, uniform_bind_group, texture_bind_group_layout, - textures: HashMap::new(), + textures: HashMap::default(), next_user_texture_id: 0, - samplers: HashMap::new(), - paint_callback_resources: TypeMap::default(), + samplers: HashMap::default(), + callback_resources: CallbackResources::default(), } } @@ -357,7 +360,7 @@ impl Renderer { pub fn render<'rp>( &'rp self, render_pass: &mut wgpu::RenderPass<'rp>, - paint_jobs: &[epaint::ClippedPrimitive], + paint_jobs: &'rp [epaint::ClippedPrimitive], screen_descriptor: &ScreenDescriptor, ) { crate::profile_function!(); @@ -432,7 +435,7 @@ impl Renderer { } } Primitive::Callback(callback) => { - let cbfn = if let Some(c) = callback.callback.downcast_ref::() { + let cbfn = if let Some(c) = callback.callback.downcast_ref::() { c } else { // We already warned in the `prepare` callback @@ -467,7 +470,7 @@ impl Renderer { ); } - (cbfn.paint)( + cbfn.0.paint( PaintCallbackInfo { viewport: callback.rect, clip_rect: *clip_rect, @@ -475,7 +478,7 @@ impl Renderer { screen_size_px: size_in_pixels, }, render_pass, - &self.paint_callback_resources, + &self.callback_resources, ); } } @@ -751,7 +754,7 @@ impl Renderer { /// Uploads the uniform, vertex and index data used by the renderer. /// Should be called before `render()`. /// - /// Returns all user-defined command buffers gathered from prepare callbacks. + /// Returns all user-defined command buffers gathered from [`CallbackTrait::prepare`] & [`CallbackTrait::finish_prepare`] callbacks. pub fn update_buffers( &mut self, device: &wgpu::Device, @@ -778,7 +781,8 @@ impl Renderer { self.previous_uniform_buffer_content = uniform_buffer_content; } - // Determine how many vertices & indices need to be rendered. + // Determine how many vertices & indices need to be rendered, and gather prepare callbacks + let mut callbacks = Vec::new(); let (vertex_count, index_count) = { crate::profile_scope!("count_vertices_indices"); paint_jobs.iter().fold((0, 0), |acc, clipped_primitive| { @@ -786,7 +790,14 @@ impl Renderer { Primitive::Mesh(mesh) => { (acc.0 + mesh.vertices.len(), acc.1 + mesh.indices.len()) } - Primitive::Callback(_) => acc, + Primitive::Callback(callback) => { + if let Some(c) = callback.callback.downcast_ref::() { + callbacks.push(c.0.as_ref()); + } else { + log::warn!("Unknown paint callback: expected `egui_wgpu::Callback`"); + }; + acc + } } }) }; @@ -861,32 +872,31 @@ impl Renderer { } } + let mut user_cmd_bufs = Vec::new(); { - crate::profile_scope!("user command buffers"); - let mut user_cmd_bufs = Vec::new(); // collect user command buffers - for epaint::ClippedPrimitive { primitive, .. } in paint_jobs.iter() { - match primitive { - Primitive::Mesh(_) => {} - Primitive::Callback(callback) => { - let cbfn = if let Some(c) = callback.callback.downcast_ref::() { - c - } else { - log::warn!("Unknown paint callback: expected `egui_wgpu::CallbackFn`"); - continue; - }; - - crate::profile_scope!("callback"); - user_cmd_bufs.extend((cbfn.prepare)( - device, - queue, - encoder, - &mut self.paint_callback_resources, - )); - } - } + crate::profile_scope!("prepare callbacks"); + for callback in &callbacks { + user_cmd_bufs.extend(callback.prepare( + device, + queue, + encoder, + &mut self.callback_resources, + )); } - user_cmd_bufs } + { + crate::profile_scope!("finish prepare callbacks"); + for callback in &callbacks { + user_cmd_bufs.extend(callback.finish_prepare( + device, + queue, + encoder, + &mut self.callback_resources, + )); + } + } + + user_cmd_bufs } } @@ -969,6 +979,9 @@ impl ScissorRect { } } +// Wgpu objects contain references to the JS heap on the web, therefore they are not Send/Sync. +// It follows that egui_wgpu::Renderer can not be Send/Sync either when building with wasm. +#[cfg(not(target_arch = "wasm32"))] #[test] fn renderer_impl_send_sync() { fn assert_send_sync() {} diff --git a/crates/egui/src/containers/area.rs b/crates/egui/src/containers/area.rs index eb940e287..ffa99219e 100644 --- a/crates/egui/src/containers/area.rs +++ b/crates/egui/src/containers/area.rs @@ -55,6 +55,8 @@ impl State { /// }); /// # }); /// ``` +/// +/// The previous rectangle used by this area can be obtained through [`crate::Memory::area_rect()`]. #[must_use = "You should call .show()"] #[derive(Clone, Copy, Debug)] pub struct Area { diff --git a/crates/egui/src/containers/collapsing_header.rs b/crates/egui/src/containers/collapsing_header.rs index 5eda61b60..5d12dc794 100644 --- a/crates/egui/src/containers/collapsing_header.rs +++ b/crates/egui/src/containers/collapsing_header.rs @@ -555,13 +555,12 @@ impl CollapsingHeader { let visuals = ui.style().interact_selectable(&header_response, selected); if ui.visuals().collapsing_header_frame || show_background { - ui.painter().add(epaint::RectShape { - rect: header_response.rect.expand(visuals.expansion), - rounding: visuals.rounding, - fill: visuals.weak_bg_fill, - stroke: visuals.bg_stroke, - // stroke: Default::default(), - }); + ui.painter().add(epaint::RectShape::new( + header_response.rect.expand(visuals.expansion), + visuals.rounding, + visuals.weak_bg_fill, + visuals.bg_stroke, + )); } if selected || selectable && (header_response.hovered() || header_response.has_focus()) diff --git a/crates/egui/src/containers/combo_box.rs b/crates/egui/src/containers/combo_box.rs index 7bc12c7de..e29b12b4a 100644 --- a/crates/egui/src/containers/combo_box.rs +++ b/crates/egui/src/containers/combo_box.rs @@ -383,12 +383,12 @@ fn button_frame( ui.painter().set( where_to_put_background, - epaint::RectShape { - rect: outer_rect.expand(visuals.expansion), - rounding: visuals.rounding, - fill: visuals.weak_bg_fill, - stroke: visuals.bg_stroke, - }, + epaint::RectShape::new( + outer_rect.expand(visuals.expansion), + visuals.rounding, + visuals.weak_bg_fill, + visuals.bg_stroke, + ), ); } diff --git a/crates/egui/src/containers/frame.rs b/crates/egui/src/containers/frame.rs index 08b5e5a0e..6ce5cbc40 100644 --- a/crates/egui/src/containers/frame.rs +++ b/crates/egui/src/containers/frame.rs @@ -235,12 +235,7 @@ impl Frame { stroke, } = *self; - let frame_shape = Shape::Rect(epaint::RectShape { - rect: outer_rect, - rounding, - fill, - stroke, - }); + let frame_shape = Shape::Rect(epaint::RectShape::new(outer_rect, rounding, fill, stroke)); if shadow == Default::default() { frame_shape diff --git a/crates/egui/src/containers/window.rs b/crates/egui/src/containers/window.rs index 5354da7fc..f03973e62 100644 --- a/crates/egui/src/containers/window.rs +++ b/crates/egui/src/containers/window.rs @@ -22,6 +22,9 @@ use super::*; /// ui.label("Hello World!"); /// }); /// # }); +/// ``` +/// +/// The previous rectangle used by this window can be obtained through [`crate::Memory::area_rect()`]. #[must_use = "You should call .show()"] pub struct Window<'open> { title: WidgetText, diff --git a/crates/egui/src/input_state.rs b/crates/egui/src/input_state.rs index 854c15704..7d2cbd743 100644 --- a/crates/egui/src/input_state.rs +++ b/crates/egui/src/input_state.rs @@ -568,6 +568,10 @@ pub struct PointerState { /// Used to check for triple-clicks. last_last_click_time: f64, + /// When was the pointer last moved? + /// Used for things like showing hover ui/tooltip with a delay. + last_move_time: f64, + /// All button events that occurred this frame pub(crate) pointer_events: Vec, } @@ -587,6 +591,7 @@ impl Default for PointerState { has_moved_too_much_for_a_click: false, last_click_time: std::f64::NEG_INFINITY, last_last_click_time: std::f64::NEG_INFINITY, + last_move_time: std::f64::NEG_INFINITY, pointer_events: vec![], } } @@ -711,6 +716,9 @@ impl PointerState { } else { Vec2::default() }; + if self.velocity != Vec2::ZERO { + self.last_move_time = time; + } self } @@ -790,6 +798,12 @@ impl PointerState { self.velocity != Vec2::ZERO } + /// How long has it been (in seconds) since the pointer was last moved? + #[inline(always)] + pub fn time_since_last_movement(&self) -> f64 { + self.time - self.last_move_time + } + /// Was any pointer button pressed (`!down -> down`) this frame? /// This can sometimes return `true` even if `any_down() == false` /// because a press can be shorted than one frame. @@ -1035,6 +1049,7 @@ impl PointerState { last_click_time, last_last_click_time, pointer_events, + last_move_time, } = self; ui.label(format!("latest_pos: {latest_pos:?}")); @@ -1052,6 +1067,7 @@ impl PointerState { )); ui.label(format!("last_click_time: {last_click_time:#?}")); ui.label(format!("last_last_click_time: {last_last_click_time:#?}")); + ui.label(format!("last_move_time: {last_move_time:#?}")); ui.label(format!("pointer_events: {pointer_events:?}")); } } diff --git a/crates/egui/src/memory.rs b/crates/egui/src/memory.rs index ba086680d..11fb39431 100644 --- a/crates/egui/src/memory.rs +++ b/crates/egui/src/memory.rs @@ -545,6 +545,11 @@ impl Memory { pub fn reset_areas(&mut self) { self.areas = Default::default(); } + + /// Obtain the previous rectangle of an area. + pub fn area_rect(&self, id: impl Into) -> Option { + self.areas.get(id.into()).map(|state| state.rect()) + } } /// ## Popups diff --git a/crates/egui/src/painter.rs b/crates/egui/src/painter.rs index 17028e6cc..ab2b0c153 100644 --- a/crates/egui/src/painter.rs +++ b/crates/egui/src/painter.rs @@ -311,12 +311,7 @@ impl Painter { fill_color: impl Into, stroke: impl Into, ) { - self.add(RectShape { - rect, - rounding: rounding.into(), - fill: fill_color.into(), - stroke: stroke.into(), - }); + self.add(RectShape::new(rect, rounding, fill_color, stroke)); } pub fn rect_filled( @@ -325,12 +320,7 @@ impl Painter { rounding: impl Into, fill_color: impl Into, ) { - self.add(RectShape { - rect, - rounding: rounding.into(), - fill: fill_color.into(), - stroke: Default::default(), - }); + self.add(RectShape::filled(rect, rounding, fill_color)); } pub fn rect_stroke( @@ -339,12 +329,7 @@ impl Painter { rounding: impl Into, stroke: impl Into, ) { - self.add(RectShape { - rect, - rounding: rounding.into(), - fill: Default::default(), - stroke: stroke.into(), - }); + self.add(RectShape::stroke(rect, rounding, stroke)); } /// Show an arrow starting at `origin` and going in the direction of `vec`, with the length `vec.length()`. diff --git a/crates/egui/src/response.rs b/crates/egui/src/response.rs index bca858ef5..e95d07c20 100644 --- a/crates/egui/src/response.rs +++ b/crates/egui/src/response.rs @@ -435,6 +435,15 @@ impl Response { } } + if !self.is_tooltip_open() + && self.ctx.input(|i| i.pointer.time_since_last_movement()) + < self.ctx.style().interaction.tooltip_delay + { + // Keep waiting until the mouse has been still for a while + self.ctx.request_repaint(); + return false; + } + // We don't want tooltips of things while we are dragging them, // but we do want tooltips while holding down on an item on a touch screen. if self diff --git a/crates/egui/src/style.rs b/crates/egui/src/style.rs index d8517fc91..3c7da1b1d 100644 --- a/crates/egui/src/style.rs +++ b/crates/egui/src/style.rs @@ -441,6 +441,9 @@ pub struct Interaction { /// If `false`, tooltips will show up anytime you hover anything, even is mouse is still moving pub show_tooltips_only_when_still: bool, + + /// Delay in seconds before showing tooltips after the mouse stops moving + pub tooltip_delay: f64, } /// Controls the visual style (colors etc) of egui. @@ -762,6 +765,7 @@ impl Default for Interaction { resize_grab_radius_side: 5.0, resize_grab_radius_corner: 10.0, show_tooltips_only_when_still: true, + tooltip_delay: 0.0, } } } @@ -1218,6 +1222,7 @@ impl Interaction { resize_grab_radius_side, resize_grab_radius_corner, show_tooltips_only_when_still, + tooltip_delay, } = self; ui.add(Slider::new(resize_grab_radius_side, 0.0..=20.0).text("resize_grab_radius_side")); ui.add( @@ -1227,6 +1232,7 @@ impl Interaction { show_tooltips_only_when_still, "Only show tooltips if mouse is still", ); + ui.add(Slider::new(tooltip_delay, 0.0..=1.0).text("tooltip_delay")); ui.vertical_centered(|ui| reset_button(ui, self)); } diff --git a/crates/egui/src/widgets/button.rs b/crates/egui/src/widgets/button.rs index ca211987a..932918ab6 100644 --- a/crates/egui/src/widgets/button.rs +++ b/crates/egui/src/widgets/button.rs @@ -318,12 +318,12 @@ impl<'a> Widget for Checkbox<'a> { // let visuals = ui.style().interact_selectable(&response, *checked); // too colorful let visuals = ui.style().interact(&response); let (small_icon_rect, big_icon_rect) = ui.spacing().icon_rectangles(rect); - ui.painter().add(epaint::RectShape { - rect: big_icon_rect.expand(visuals.expansion), - rounding: visuals.rounding, - fill: visuals.bg_fill, - stroke: visuals.bg_stroke, - }); + ui.painter().add(epaint::RectShape::new( + big_icon_rect.expand(visuals.expansion), + visuals.rounding, + visuals.bg_fill, + visuals.bg_stroke, + )); if *checked { // Check mark: @@ -535,7 +535,7 @@ impl Widget for ImageButton { let selection = ui.visuals().selection; ( Vec2::ZERO, - Rounding::none(), + Rounding::ZERO, selection.bg_fill, selection.stroke, ) @@ -552,6 +552,8 @@ impl Widget for ImageButton { Default::default() }; + let image = image.rounding(rounding); // apply rounding to the image + // Draw frame background (for transparent images): ui.painter() .rect_filled(rect.expand2(expansion), rounding, fill); diff --git a/crates/egui/src/widgets/image.rs b/crates/egui/src/widgets/image.rs index eaf4584d3..487af9d38 100644 --- a/crates/egui/src/widgets/image.rs +++ b/crates/egui/src/widgets/image.rs @@ -42,6 +42,7 @@ pub struct Image { tint: Color32, sense: Sense, rotation: Option<(Rot2, Vec2)>, + rounding: Rounding, } impl Image { @@ -54,6 +55,7 @@ impl Image { tint: Color32::WHITE, sense: Sense::hover(), rotation: None, + rounding: Rounding::ZERO, } } @@ -89,8 +91,26 @@ impl Image { /// Origin is a vector in normalized UV space ((0,0) in top-left, (1,1) bottom right). /// /// To rotate about the center you can pass `Vec2::splat(0.5)` as the origin. + /// + /// Due to limitations in the current implementation, + /// this will turn off rounding of the image. pub fn rotate(mut self, angle: f32, origin: Vec2) -> Self { self.rotation = Some((Rot2::from_angle(angle), origin)); + self.rounding = Rounding::ZERO; // incompatible with rotation + self + } + + /// Round the corners of the image. + /// + /// The default is no rounding ([`Rounding::ZERO`]). + /// + /// Due to limitations in the current implementation, + /// this will turn off any rotation of the image. + pub fn rounding(mut self, rounding: impl Into) -> Self { + self.rounding = rounding.into(); + if self.rounding != Rounding::ZERO { + self.rotation = None; // incompatible with rounding + } self } } @@ -111,6 +131,7 @@ impl Image { tint, sense: _, rotation, + rounding, } = self; if *bg_fill != Default::default() { @@ -119,14 +140,27 @@ impl Image { ui.painter().add(Shape::mesh(mesh)); } - { - // TODO(emilk): builder pattern for Mesh + if let Some((rot, origin)) = rotation { + // TODO(emilk): implement this using `PathShape` (add texture support to it). + // This will also give us anti-aliasing of rotated images. + egui_assert!( + *rounding == Rounding::ZERO, + "Image had both rounding and rotation. Please pick only one" + ); + let mut mesh = Mesh::with_texture(*texture_id); mesh.add_rect_with_uv(rect, *uv, *tint); - if let Some((rot, origin)) = rotation { - mesh.rotate(*rot, rect.min + *origin * *size); - } + mesh.rotate(*rot, rect.min + *origin * *size); ui.painter().add(Shape::mesh(mesh)); + } else { + ui.painter().add(RectShape { + rect, + rounding: *rounding, + fill: *tint, + stroke: Stroke::NONE, + fill_texture_id: *texture_id, + uv: *uv, + }); } } } diff --git a/crates/egui/src/widgets/plot/axis.rs b/crates/egui/src/widgets/plot/axis.rs index 6430378bd..0ed2eabd9 100644 --- a/crates/egui/src/widgets/plot/axis.rs +++ b/crates/egui/src/widgets/plot/axis.rs @@ -9,7 +9,7 @@ use crate::{Response, Sense, TextStyle, Ui, WidgetText}; use super::{transform::PlotTransform, GridMark}; -pub(super) type AxisFormatterFn = fn(f64, usize, &RangeInclusive) -> String; +pub(super) type AxisFormatterFn = dyn Fn(f64, usize, &RangeInclusive) -> String; /// X or Y axis. #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -81,7 +81,7 @@ impl From for Placement { #[derive(Clone)] pub struct AxisHints { pub(super) label: WidgetText, - pub(super) formatter: AxisFormatterFn, + pub(super) formatter: Arc, pub(super) digits: usize, pub(super) placement: Placement, } @@ -98,7 +98,7 @@ impl Default for AxisHints { fn default() -> Self { Self { label: Default::default(), - formatter: Self::default_formatter, + formatter: Arc::new(Self::default_formatter), digits: 5, placement: Placement::LeftBottom, } @@ -111,8 +111,11 @@ impl AxisHints { /// The first parameter of `formatter` is the raw tick value as `f64`. /// The second parameter is the maximum number of characters that fit into y-labels. /// The second parameter of `formatter` is the currently shown range on this axis. - pub fn formatter(mut self, fmt: fn(f64, usize, &RangeInclusive) -> String) -> Self { - self.formatter = fmt; + pub fn formatter( + mut self, + fmt: impl Fn(f64, usize, &RangeInclusive) -> String + 'static, + ) -> Self { + self.formatter = Arc::new(fmt); self } diff --git a/crates/egui/src/widgets/plot/items/bar.rs b/crates/egui/src/widgets/plot/items/bar.rs index 4ab6ebc7f..7c4dbab00 100644 --- a/crates/egui/src/widgets/plot/items/bar.rs +++ b/crates/egui/src/widgets/plot/items/bar.rs @@ -127,12 +127,7 @@ impl Bar { }; let rect = transform.rect_from_values(&self.bounds_min(), &self.bounds_max()); - let rect = Shape::Rect(RectShape { - rect, - rounding: Rounding::none(), - fill, - stroke, - }); + let rect = Shape::Rect(RectShape::new(rect, Rounding::ZERO, fill, stroke)); shapes.push(rect); } diff --git a/crates/egui/src/widgets/plot/items/box_elem.rs b/crates/egui/src/widgets/plot/items/box_elem.rs index 3f9151083..dab53fd77 100644 --- a/crates/egui/src/widgets/plot/items/box_elem.rs +++ b/crates/egui/src/widgets/plot/items/box_elem.rs @@ -150,12 +150,7 @@ impl BoxElem { &self.point_at(self.argument - self.box_width / 2.0, self.spread.quartile1), &self.point_at(self.argument + self.box_width / 2.0, self.spread.quartile3), ); - let rect = Shape::Rect(RectShape { - rect, - rounding: Rounding::none(), - fill, - stroke, - }); + let rect = Shape::Rect(RectShape::new(rect, Rounding::ZERO, fill, stroke)); shapes.push(rect); let line_between = |v1, v2| { diff --git a/crates/egui/src/widgets/plot/mod.rs b/crates/egui/src/widgets/plot/mod.rs index 456f3dc16..e1f3ffc0b 100644 --- a/crates/egui/src/widgets/plot/mod.rs +++ b/crates/egui/src/widgets/plot/mod.rs @@ -613,24 +613,32 @@ impl Plot { /// Specify custom formatter for ticks on the main X-axis. /// - /// The first parameter of `fmt` is the raw tick value as `f64`. - /// The second parameter is the maximum requested number of characters per tick label. - /// The second parameter of `fmt` is the currently shown range on this axis. - pub fn x_axis_formatter(mut self, fmt: fn(f64, usize, &RangeInclusive) -> String) -> Self { + /// Arguments of `fmt`: + /// * raw tick value as `f64`. + /// * maximum requested number of characters per tick label. + /// * currently shown range on this axis. + pub fn x_axis_formatter( + mut self, + fmt: impl Fn(f64, usize, &RangeInclusive) -> String + 'static, + ) -> Self { if let Some(main) = self.x_axes.first_mut() { - main.formatter = fmt; + main.formatter = Arc::new(fmt); } self } /// Specify custom formatter for ticks on the main Y-axis. /// - /// The first parameter of `formatter` is the raw tick value as `f64`. - /// The second parameter is the maximum requested number of characters per tick label. - /// The second parameter of `formatter` is the currently shown range on this axis. - pub fn y_axis_formatter(mut self, fmt: fn(f64, usize, &RangeInclusive) -> String) -> Self { + /// Arguments of `fmt`: + /// * raw tick value as `f64`. + /// * maximum requested number of characters per tick label. + /// * currently shown range on this axis. + pub fn y_axis_formatter( + mut self, + fmt: impl Fn(f64, usize, &RangeInclusive) -> String + 'static, + ) -> Self { if let Some(main) = self.y_axes.first_mut() { - main.formatter = fmt; + main.formatter = Arc::new(fmt); } self } @@ -864,12 +872,14 @@ impl Plot { // Background if show_background { - ui.painter().with_clip_rect(rect).add(epaint::RectShape { - rect, - rounding: Rounding::same(2.0), - fill: ui.visuals().extreme_bg_color, - stroke: ui.visuals().widgets.noninteractive.bg_stroke, - }); + ui.painter() + .with_clip_rect(rect) + .add(epaint::RectShape::new( + rect, + Rounding::same(2.0), + ui.visuals().extreme_bg_color, + ui.visuals().widgets.noninteractive.bg_stroke, + )); } // --- Legend --- diff --git a/crates/egui/src/widgets/text_edit/builder.rs b/crates/egui/src/widgets/text_edit/builder.rs index e92bf9dbc..3019fa7fd 100644 --- a/crates/egui/src/widgets/text_edit/builder.rs +++ b/crates/egui/src/widgets/text_edit/builder.rs @@ -368,31 +368,27 @@ impl<'t> TextEdit<'t> { let frame_rect = frame_rect.expand(visuals.expansion); let shape = if is_mutable { if output.response.has_focus() { - epaint::RectShape { - rect: frame_rect, - rounding: visuals.rounding, - // fill: ui.visuals().selection.bg_fill, - fill: ui.visuals().extreme_bg_color, - stroke: ui.visuals().selection.stroke, - } + epaint::RectShape::new( + frame_rect, + visuals.rounding, + ui.visuals().extreme_bg_color, + ui.visuals().selection.stroke, + ) } else { - epaint::RectShape { - rect: frame_rect, - rounding: visuals.rounding, - fill: ui.visuals().extreme_bg_color, - stroke: visuals.bg_stroke, // TODO(emilk): we want to show something here, or a text-edit field doesn't "pop". - } + epaint::RectShape::new( + frame_rect, + visuals.rounding, + ui.visuals().extreme_bg_color, + visuals.bg_stroke, // TODO(emilk): we want to show something here, or a text-edit field doesn't "pop". + ) } } else { let visuals = &ui.style().visuals.widgets.inactive; - epaint::RectShape { - rect: frame_rect, - rounding: visuals.rounding, - // fill: ui.visuals().extreme_bg_color, - // fill: visuals.bg_fill, - fill: Color32::TRANSPARENT, - stroke: visuals.bg_stroke, // TODO(emilk): we want to show something here, or a text-edit field doesn't "pop". - } + epaint::RectShape::stroke( + frame_rect, + visuals.rounding, + visuals.bg_stroke, // TODO(emilk): we want to show something here, or a text-edit field doesn't "pop". + ) }; ui.painter().set(where_to_put_background, shape); diff --git a/crates/egui_demo_app/src/apps/custom3d_wgpu.rs b/crates/egui_demo_app/src/apps/custom3d_wgpu.rs index a3b193865..34cd960b9 100644 --- a/crates/egui_demo_app/src/apps/custom3d_wgpu.rs +++ b/crates/egui_demo_app/src/apps/custom3d_wgpu.rs @@ -1,4 +1,4 @@ -use std::{num::NonZeroU64, sync::Arc}; +use std::num::NonZeroU64; use eframe::{ egui_wgpu::wgpu::util::DeviceExt, @@ -85,7 +85,7 @@ impl Custom3d { wgpu_render_state .renderer .write() - .paint_callback_resources + .callback_resources .insert(TriangleRenderResources { pipeline, bind_group, @@ -129,46 +129,64 @@ impl eframe::App for Custom3d { } } +// Callbacks in egui_wgpu have 3 stages: +// * prepare (per callback impl) +// * finish_prepare (once) +// * paint (per callback impl) +// +// The prepare callback is called every frame before paint and is given access to the wgpu +// Device and Queue, which can be used, for instance, to update buffers and uniforms before +// rendering. +// If [`egui_wgpu::Renderer`] has [`egui_wgpu::FinishPrepareCallback`] registered, +// it will be called after all `prepare` callbacks have been called. +// You can use this to update any shared resources that need to be updated once per frame +// after all callbacks have been processed. +// +// On both prepare methods you can use the main `CommandEncoder` that is passed-in, +// return an arbitrary number of user-defined `CommandBuffer`s, or both. +// The main command buffer, as well as all user-defined ones, will be submitted together +// to the GPU in a single call. +// +// The paint callback is called after finish prepare and is given access to egui's main render pass, +// which can be used to issue draw commands. +struct CustomTriangleCallback { + angle: f32, +} + +impl egui_wgpu::CallbackTrait for CustomTriangleCallback { + fn prepare( + &self, + device: &wgpu::Device, + queue: &wgpu::Queue, + _egui_encoder: &mut wgpu::CommandEncoder, + resources: &mut egui_wgpu::CallbackResources, + ) -> Vec { + let resources: &TriangleRenderResources = resources.get().unwrap(); + resources.prepare(device, queue, self.angle); + Vec::new() + } + + fn paint<'a>( + &self, + _info: egui::PaintCallbackInfo, + render_pass: &mut wgpu::RenderPass<'a>, + resources: &'a egui_wgpu::CallbackResources, + ) { + let resources: &TriangleRenderResources = resources.get().unwrap(); + resources.paint(render_pass); + } +} + impl Custom3d { fn custom_painting(&mut self, ui: &mut egui::Ui) { let (rect, response) = ui.allocate_exact_size(egui::Vec2::splat(300.0), egui::Sense::drag()); self.angle += response.drag_delta().x * 0.01; - - // Clone locals so we can move them into the paint callback: - let angle = self.angle; - - // The callback function for WGPU is in two stages: prepare, and paint. - // - // The prepare callback is called every frame before paint and is given access to the wgpu - // Device and Queue, which can be used, for instance, to update buffers and uniforms before - // rendering. - // - // You can use the main `CommandEncoder` that is passed-in, return an arbitrary number - // of user-defined `CommandBuffer`s, or both. - // The main command buffer, as well as all user-defined ones, will be submitted together - // to the GPU in a single call. - // - // The paint callback is called after prepare and is given access to the render pass, which - // can be used to issue draw commands. - let cb = egui_wgpu::CallbackFn::new() - .prepare(move |device, queue, _encoder, paint_callback_resources| { - let resources: &TriangleRenderResources = paint_callback_resources.get().unwrap(); - resources.prepare(device, queue, angle); - Vec::new() - }) - .paint(move |_info, render_pass, paint_callback_resources| { - let resources: &TriangleRenderResources = paint_callback_resources.get().unwrap(); - resources.paint(render_pass); - }); - - let callback = egui::PaintCallback { + ui.painter().add(egui_wgpu::Callback::new_paint_callback( rect, - callback: Arc::new(cb), - }; - - ui.painter().add(callback); + CustomTriangleCallback { angle: self.angle }, + )); } } diff --git a/crates/egui_demo_app/src/frame_history.rs b/crates/egui_demo_app/src/frame_history.rs index 946f8ff91..f85a3a489 100644 --- a/crates/egui_demo_app/src/frame_history.rs +++ b/crates/egui_demo_app/src/frame_history.rs @@ -70,12 +70,12 @@ impl FrameHistory { let to_screen = emath::RectTransform::from_to(graph_rect, rect); let mut shapes = Vec::with_capacity(3 + 2 * history.len()); - shapes.push(Shape::Rect(epaint::RectShape { + shapes.push(Shape::Rect(epaint::RectShape::new( rect, - rounding: style.rounding, - fill: ui.visuals().extreme_bg_color, - stroke: ui.style().noninteractive().bg_stroke, - })); + style.rounding, + ui.visuals().extreme_bg_color, + ui.style().noninteractive().bg_stroke, + ))); let rect = rect.shrink(4.0); let color = ui.visuals().text_color(); diff --git a/crates/egui_demo_lib/src/demo/drag_and_drop.rs b/crates/egui_demo_lib/src/demo/drag_and_drop.rs index b6314e90e..7e5191c77 100644 --- a/crates/egui_demo_lib/src/demo/drag_and_drop.rs +++ b/crates/egui_demo_lib/src/demo/drag_and_drop.rs @@ -64,12 +64,7 @@ pub fn drop_target( ui.painter().set( where_to_put_background, - epaint::RectShape { - rounding: style.rounding, - fill, - stroke, - rect, - }, + epaint::RectShape::new(rect, style.rounding, fill, stroke), ); InnerResponse::new(ret, response) diff --git a/crates/egui_glium/examples/native_texture.rs b/crates/egui_glium/examples/native_texture.rs index b19b08f0c..94977cd61 100644 --- a/crates/egui_glium/examples/native_texture.rs +++ b/crates/egui_glium/examples/native_texture.rs @@ -8,7 +8,7 @@ fn main() { let mut egui_glium = egui_glium::EguiGlium::new(&display, &event_loop); - let png_data = include_bytes!("../../../examples/retained_image/src/rust-logo-256x256.png"); + let png_data = include_bytes!("../../../examples/retained_image/src/crab.png"); let image = load_glium_image(png_data); let image_size = egui::vec2(image.width as f32, image.height as f32); // Load to gpu memory diff --git a/crates/emath/src/rect.rs b/crates/emath/src/rect.rs index d6d148d27..0d5a1e8cd 100644 --- a/crates/emath/src/rect.rs +++ b/crates/emath/src/rect.rs @@ -58,6 +58,12 @@ impl Rect { max: pos2(f32::NAN, f32::NAN), }; + /// A [`Rect`] filled with zeroes. + pub const ZERO: Self = Self { + min: Pos2::ZERO, + max: Pos2::ZERO, + }; + #[inline(always)] pub const fn from_min_max(min: Pos2, max: Pos2) -> Self { Rect { min, max } diff --git a/crates/epaint/src/mesh.rs b/crates/epaint/src/mesh.rs index 62f0de21f..266b46a0f 100644 --- a/crates/epaint/src/mesh.rs +++ b/crates/epaint/src/mesh.rs @@ -120,13 +120,13 @@ impl Mesh { pub fn append_ref(&mut self, other: &Mesh) { crate::epaint_assert!(other.is_valid()); - if !self.is_empty() { + if self.is_empty() { + self.texture_id = other.texture_id; + } else { assert_eq!( self.texture_id, other.texture_id, "Can't merge Mesh using different textures" ); - } else { - self.texture_id = other.texture_id; } let index_offset = self.vertices.len() as u32; diff --git a/crates/epaint/src/shape.rs b/crates/epaint/src/shape.rs index 401f51d8a..8854a2e86 100644 --- a/crates/epaint/src/shape.rs +++ b/crates/epaint/src/shape.rs @@ -282,6 +282,8 @@ impl Shape { pub fn texture_id(&self) -> super::TextureId { if let Shape::Mesh(mesh) = self { mesh.texture_id + } else if let Shape::Rect(rect_shape) = self { + rect_shape.fill_texture_id } else { super::TextureId::default() } @@ -406,6 +408,8 @@ pub struct PathShape { /// Color and thickness of the line. pub stroke: Stroke, + // TODO(emilk): Add texture support either by supplying uv for each point, + // or by some transform from points to uv (e.g. a callback or a linear transform matrix). } impl PathShape { @@ -476,7 +480,7 @@ impl From for Shape { pub struct RectShape { pub rect: Rect, - /// How rounded the corners are. Use `Rounding::none()` for no rounding. + /// How rounded the corners are. Use `Rounding::ZERO` for no rounding. pub rounding: Rounding, /// How to fill the rectangle. @@ -484,9 +488,37 @@ pub struct RectShape { /// The thickness and color of the outline. pub stroke: Stroke, + + /// If the rect should be filled with a texture, which one? + /// + /// The texture is multiplied with [`Self::fill`]. + pub fill_texture_id: TextureId, + + /// What UV coordinates to use for the texture? + /// + /// To display a texture, set [`Self::fill_texture_id`], + /// and set this to `Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0))`. + pub uv: Rect, } impl RectShape { + #[inline] + pub fn new( + rect: Rect, + rounding: impl Into, + fill_color: impl Into, + stroke: impl Into, + ) -> Self { + Self { + rect, + rounding: rounding.into(), + fill: fill_color.into(), + stroke: stroke.into(), + fill_texture_id: Default::default(), + uv: Rect::ZERO, + } + } + #[inline] pub fn filled( rect: Rect, @@ -498,6 +530,8 @@ impl RectShape { rounding: rounding.into(), fill: fill_color.into(), stroke: Default::default(), + fill_texture_id: Default::default(), + uv: Rect::ZERO, } } @@ -508,6 +542,8 @@ impl RectShape { rounding: rounding.into(), fill: Default::default(), stroke: stroke.into(), + fill_texture_id: Default::default(), + uv: Rect::ZERO, } } @@ -549,7 +585,7 @@ pub struct Rounding { impl Default for Rounding { #[inline] fn default() -> Self { - Self::none() + Self::ZERO } } @@ -566,6 +602,14 @@ impl From for Rounding { } impl Rounding { + /// No rounding on any corner. + pub const ZERO: Self = Self { + nw: 0.0, + ne: 0.0, + sw: 0.0, + se: 0.0, + }; + #[inline] pub fn same(radius: f32) -> Self { Self { @@ -577,6 +621,7 @@ impl Rounding { } #[inline] + #[deprecated = "Use Rounding::ZERO"] pub fn none() -> Self { Self { nw: 0.0, @@ -807,7 +852,7 @@ pub struct PaintCallback { /// /// The concrete value of `callback` depends on the rendering backend used. For instance, the /// `glow` backend requires that callback be an `egui_glow::CallbackFn` while the `wgpu` - /// backend requires a `egui_wgpu::CallbackFn`. + /// backend requires a `egui_wgpu::Callback`. /// /// If the type cannot be downcast to the type expected by the current backend the callback /// will not be drawn. @@ -817,7 +862,9 @@ pub struct PaintCallback { /// /// The rendering backend is also responsible for restoring any state, such as the bound shader /// program, vertex array, etc. - pub callback: Arc, + /// + /// Shape has to be clone, therefore this has to be an `Arc` instead of a `Box`. + pub callback: Arc, } impl std::fmt::Debug for PaintCallback { diff --git a/crates/epaint/src/tessellator.rs b/crates/epaint/src/tessellator.rs index facb2612d..44300cab2 100644 --- a/crates/epaint/src/tessellator.rs +++ b/crates/epaint/src/tessellator.rs @@ -492,6 +492,20 @@ impl Path { pub fn fill(&mut self, feathering: f32, color: Color32, out: &mut Mesh) { fill_closed_path(feathering, &mut self.0, color, out); } + + /// Like [`Self::fill`] but with texturing. + /// + /// The `uv_from_pos` is called for each vertex position. + pub fn fill_with_uv( + &mut self, + feathering: f32, + color: Color32, + texture_id: TextureId, + uv_from_pos: impl Fn(Pos2) -> Pos2, + out: &mut Mesh, + ) { + fill_closed_path_with_uv(feathering, &mut self.0, color, texture_id, uv_from_pos, out); + } } pub mod path { @@ -508,7 +522,7 @@ pub mod path { let r = clamp_radius(rounding, rect); - if r == Rounding::none() { + if r == Rounding::ZERO { let min = rect.min; let max = rect.max; path.reserve(4); @@ -728,6 +742,89 @@ fn fill_closed_path(feathering: f32, path: &mut [PathPoint], color: Color32, out } } +/// Like [`fill_closed_path`] but with texturing. +/// +/// The `uv_from_pos` is called for each vertex position. +fn fill_closed_path_with_uv( + feathering: f32, + path: &mut [PathPoint], + color: Color32, + texture_id: TextureId, + uv_from_pos: impl Fn(Pos2) -> Pos2, + out: &mut Mesh, +) { + if color == Color32::TRANSPARENT { + return; + } + + if out.is_empty() { + out.texture_id = texture_id; + } else { + assert_eq!( + out.texture_id, texture_id, + "Mixing different `texture_id` in the same " + ); + } + + let n = path.len() as u32; + if feathering > 0.0 { + if cw_signed_area(path) < 0.0 { + // Wrong winding order - fix: + path.reverse(); + for point in path.iter_mut() { + point.normal = -point.normal; + } + } + + out.reserve_triangles(3 * n as usize); + out.reserve_vertices(2 * n as usize); + let color_outer = Color32::TRANSPARENT; + let idx_inner = out.vertices.len() as u32; + let idx_outer = idx_inner + 1; + + // The fill: + for i in 2..n { + out.add_triangle(idx_inner + 2 * (i - 1), idx_inner, idx_inner + 2 * i); + } + + // The feathering: + let mut i0 = n - 1; + for i1 in 0..n { + let p1 = &path[i1 as usize]; + let dm = 0.5 * feathering * p1.normal; + + let pos = p1.pos - dm; + out.vertices.push(Vertex { + pos, + uv: uv_from_pos(pos), + color, + }); + + let pos = p1.pos + dm; + out.vertices.push(Vertex { + pos, + uv: uv_from_pos(pos), + color: color_outer, + }); + + out.add_triangle(idx_inner + i1 * 2, idx_inner + i0 * 2, idx_outer + 2 * i0); + out.add_triangle(idx_outer + i0 * 2, idx_outer + i1 * 2, idx_inner + 2 * i1); + i0 = i1; + } + } else { + out.reserve_triangles(n as usize); + let idx = out.vertices.len() as u32; + out.vertices.extend(path.iter().map(|p| Vertex { + pos: p.pos, + uv: uv_from_pos(p.pos), + color, + })); + for i in 2..n { + out.add_triangle(idx, idx + i - 1, idx + i); + } + } +} + /// Tessellate the given path as a stroke with thickness. fn stroke_path( feathering: f32, @@ -1304,6 +1401,8 @@ impl Tessellator { rounding, fill, stroke, + fill_texture_id, + uv, } = *rect; if self.options.coarse_tessellation_culling @@ -1345,7 +1444,21 @@ impl Tessellator { path.clear(); path::rounded_rectangle(&mut self.scratchpad_points, rect, rounding); path.add_line_loop(&self.scratchpad_points); - path.fill(self.feathering, fill, out); + + if uv.is_positive() { + // Textured + let uv_from_pos = |p: Pos2| { + pos2( + remap(p.x, rect.x_range(), uv.x_range()), + remap(p.y, rect.y_range(), uv.y_range()), + ) + }; + path.fill_with_uv(self.feathering, fill, fill_texture_id, uv_from_pos, out); + } else { + // Untextured + path.fill(self.feathering, fill, out); + } + path.stroke_closed(self.feathering, stroke, out); } } diff --git a/docs/egui_demo_app.js b/docs/egui_demo_app.js index c500ceebd..8524a9200 100644 --- a/docs/egui_demo_app.js +++ b/docs/egui_demo_app.js @@ -75,14 +75,14 @@ function passStringToWasm0(arg, malloc, realloc) { if (realloc === undefined) { const buf = cachedTextEncoder.encode(arg); - const ptr = malloc(buf.length) >>> 0; + const ptr = malloc(buf.length, 1) >>> 0; getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); WASM_VECTOR_LEN = buf.length; return ptr; } let len = arg.length; - let ptr = malloc(len) >>> 0; + let ptr = malloc(len, 1) >>> 0; const mem = getUint8Memory0(); @@ -98,7 +98,7 @@ function passStringToWasm0(arg, malloc, realloc) { if (offset !== 0) { arg = arg.slice(offset); } - ptr = realloc(ptr, len, len = offset + arg.length * 3) >>> 0; + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; const view = getUint8Memory0().subarray(ptr + offset, ptr + len); const ret = encodeString(arg, view); @@ -221,9 +221,13 @@ function makeMutClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_28(arg0, arg1) { + wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h523cfda7f0d44218(arg0, arg1); +} + +function __wbg_adapter_31(arg0, arg1) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3016326a7c9d0bd0(retptr, arg0, arg1); + wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h94e2299a5b82545f(retptr, arg0, arg1); var r0 = getInt32Memory0()[retptr / 4 + 0]; var r1 = getInt32Memory0()[retptr / 4 + 1]; if (r1) { @@ -234,12 +238,8 @@ function __wbg_adapter_28(arg0, arg1) { } } -function __wbg_adapter_31(arg0, arg1) { - wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbecb4c8c4c1689b4(arg0, arg1); -} - function __wbg_adapter_34(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3ed37d848238a431(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h64ea11302d5f5d14(arg0, arg1, addHeapObject(arg2)); } function makeClosure(arg0, arg1, dtor, f) { @@ -264,11 +264,11 @@ function makeClosure(arg0, arg1, dtor, f) { return real; } function __wbg_adapter_37(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h049b4e5b45eb9682(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb124382083cfbddf(arg0, arg1, addHeapObject(arg2)); } function __wbg_adapter_42(arg0, arg1, arg2) { - wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h719a81cc1cd97a97(arg0, arg1, addHeapObject(arg2)); + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbe35f1bd5c558805(arg0, arg1, addHeapObject(arg2)); } function handleError(f, args) { @@ -279,7 +279,7 @@ function handleError(f, args) { } } function __wbg_adapter_580(arg0, arg1, arg2, arg3) { - wasm.wasm_bindgen__convert__closures__invoke2_mut__h4f6627fcd09764ad(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); + wasm.wasm_bindgen__convert__closures__invoke2_mut__h352520d82dcfcae6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); } /** @@ -425,14 +425,6 @@ function __wbg_get_imports() { imports.wbg.__wbindgen_object_drop_ref = function(arg0) { takeObject(arg0); }; - imports.wbg.__wbindgen_string_get = function(arg0, arg1) { - const obj = getObject(arg1); - const ret = typeof(obj) === 'string' ? obj : undefined; - var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }; imports.wbg.__wbindgen_cb_drop = function(arg0) { const obj = takeObject(arg0).original; if (obj.cnt-- == 1) { @@ -442,6 +434,20 @@ function __wbg_get_imports() { const ret = false; return ret; }; + imports.wbg.__wbindgen_string_get = function(arg0, arg1) { + const obj = getObject(arg1); + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbindgen_number_get = function(arg0, arg1) { + const obj = getObject(arg1); + const ret = typeof(obj) === 'number' ? obj : undefined; + getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; + getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); + }; imports.wbg.__wbg_error_ef675d96d0bf24dc = function(arg0, arg1) { let deferred0_0; let deferred0_1; @@ -450,7 +456,7 @@ function __wbg_get_imports() { deferred0_1 = arg1; console.error(getStringFromWasm0(arg0, arg1)); } finally { - wasm.__wbindgen_free(deferred0_0, deferred0_1); + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); } }; imports.wbg.__wbg_new_475b88b4c50a6bba = function() { @@ -464,11 +470,9 @@ function __wbg_get_imports() { getInt32Memory0()[arg0 / 4 + 1] = len1; getInt32Memory0()[arg0 / 4 + 0] = ptr1; }; - imports.wbg.__wbindgen_number_get = function(arg0, arg1) { - const obj = getObject(arg1); - const ret = typeof(obj) === 'number' ? obj : undefined; - getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; - getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); }; imports.wbg.__wbg_trace_822e2ec9f55bdc14 = function(arg0, arg1) { console.trace(getStringFromWasm0(arg0, arg1)); @@ -482,16 +486,12 @@ function __wbg_get_imports() { imports.wbg.__wbg_warn_0d84cc9f60d72161 = function(arg0, arg1) { console.warn(getStringFromWasm0(arg0, arg1)); }; - imports.wbg.__wbindgen_object_clone_ref = function(arg0) { - const ret = getObject(arg0); - return addHeapObject(ret); - }; imports.wbg.__wbindgen_boolean_get = function(arg0) { const v = getObject(arg0); const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; return ret; }; - imports.wbg.__wbg_instanceof_WebGl2RenderingContext_a9b8e563e17071fe = function(arg0) { + imports.wbg.__wbg_instanceof_WebGl2RenderingContext_f921526c513bf717 = function(arg0) { let result; try { result = getObject(arg0) instanceof WebGL2RenderingContext; @@ -501,187 +501,187 @@ function __wbg_get_imports() { const ret = result; return ret; }; - imports.wbg.__wbg_bindVertexArray_ff82138c68ab11e2 = function(arg0, arg1) { + imports.wbg.__wbg_bindVertexArray_8863a216d7b0a339 = function(arg0, arg1) { getObject(arg0).bindVertexArray(getObject(arg1)); }; - imports.wbg.__wbg_bufferData_bc2f1a27f7162655 = function(arg0, arg1, arg2, arg3) { + imports.wbg.__wbg_bufferData_21334671c4ba6004 = function(arg0, arg1, arg2, arg3) { getObject(arg0).bufferData(arg1 >>> 0, getObject(arg2), arg3 >>> 0); }; - imports.wbg.__wbg_createVertexArray_c3ea33e844216f0c = function(arg0) { + imports.wbg.__wbg_createVertexArray_51d51e1e1e13e9f6 = function(arg0) { const ret = getObject(arg0).createVertexArray(); return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_deleteVertexArray_6cac5e6d920ec62c = function(arg0, arg1) { + imports.wbg.__wbg_deleteVertexArray_3e4f2e2ff7f05a19 = function(arg0, arg1) { getObject(arg0).deleteVertexArray(getObject(arg1)); }; - imports.wbg.__wbg_texImage2D_dd4aced57a17360f = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + imports.wbg.__wbg_texImage2D_07240affd06971e9 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { getObject(arg0).texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, getObject(arg9)); }, arguments) }; - imports.wbg.__wbg_texSubImage2D_c3c012dc814eb4de = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + imports.wbg.__wbg_texSubImage2D_d2841ded12a8aa66 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { getObject(arg0).texSubImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, getObject(arg9)); }, arguments) }; - imports.wbg.__wbg_texSubImage2D_6cc58218d4d2218e = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + imports.wbg.__wbg_texSubImage2D_bccf4e250f1ce1b8 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { getObject(arg0).texSubImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, arg9); }, arguments) }; - imports.wbg.__wbg_activeTexture_0c3957272c193058 = function(arg0, arg1) { + imports.wbg.__wbg_activeTexture_799bf1387e911c27 = function(arg0, arg1) { getObject(arg0).activeTexture(arg1 >>> 0); }; - imports.wbg.__wbg_attachShader_cda29f0482c65440 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_attachShader_47256b6b3d42a22e = function(arg0, arg1, arg2) { getObject(arg0).attachShader(getObject(arg1), getObject(arg2)); }; - imports.wbg.__wbg_bindBuffer_6f9a2fa9ebc65b01 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_bindBuffer_24f6010e273fa400 = function(arg0, arg1, arg2) { getObject(arg0).bindBuffer(arg1 >>> 0, getObject(arg2)); }; - imports.wbg.__wbg_bindTexture_10219c0f804bff90 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_bindTexture_92d6d7f8bff9531e = function(arg0, arg1, arg2) { getObject(arg0).bindTexture(arg1 >>> 0, getObject(arg2)); }; - imports.wbg.__wbg_blendEquationSeparate_02dd5ec6a2c24f28 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_blendEquationSeparate_205526dad772d160 = function(arg0, arg1, arg2) { getObject(arg0).blendEquationSeparate(arg1 >>> 0, arg2 >>> 0); }; - imports.wbg.__wbg_blendFuncSeparate_f9dccffef5a98f44 = function(arg0, arg1, arg2, arg3, arg4) { + imports.wbg.__wbg_blendFuncSeparate_fbf93dee3e5ce456 = function(arg0, arg1, arg2, arg3, arg4) { getObject(arg0).blendFuncSeparate(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0); }; - imports.wbg.__wbg_clear_15c6565459b2686d = function(arg0, arg1) { + imports.wbg.__wbg_clear_2db2efe323bfdf68 = function(arg0, arg1) { getObject(arg0).clear(arg1 >>> 0); }; - imports.wbg.__wbg_clearColor_116005afbb6df00f = function(arg0, arg1, arg2, arg3, arg4) { + imports.wbg.__wbg_clearColor_7a7d04702f7e38e5 = function(arg0, arg1, arg2, arg3, arg4) { getObject(arg0).clearColor(arg1, arg2, arg3, arg4); }; - imports.wbg.__wbg_colorMask_1dfb9a91ae2b9e71 = function(arg0, arg1, arg2, arg3, arg4) { + imports.wbg.__wbg_colorMask_fba1e2efd891e2ac = function(arg0, arg1, arg2, arg3, arg4) { getObject(arg0).colorMask(arg1 !== 0, arg2 !== 0, arg3 !== 0, arg4 !== 0); }; - imports.wbg.__wbg_compileShader_6f505d659e2795e6 = function(arg0, arg1) { + imports.wbg.__wbg_compileShader_6bf78b425d5c98e1 = function(arg0, arg1) { getObject(arg0).compileShader(getObject(arg1)); }; - imports.wbg.__wbg_createBuffer_0da7eb27184081a8 = function(arg0) { + imports.wbg.__wbg_createBuffer_323425af422748ac = function(arg0) { const ret = getObject(arg0).createBuffer(); return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_createProgram_535e1a7a84baa7ff = function(arg0) { + imports.wbg.__wbg_createProgram_4eaf3b97b5747a62 = function(arg0) { const ret = getObject(arg0).createProgram(); return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_createShader_b1a69c91a9abbcf9 = function(arg0, arg1) { + imports.wbg.__wbg_createShader_429776c9dd6fb87b = function(arg0, arg1) { const ret = getObject(arg0).createShader(arg1 >>> 0); return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_createTexture_f999863e1ff4544e = function(arg0) { + imports.wbg.__wbg_createTexture_1bf4d6fec570124b = function(arg0) { const ret = getObject(arg0).createTexture(); return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_deleteBuffer_d6466e666563f36a = function(arg0, arg1) { + imports.wbg.__wbg_deleteBuffer_2c09d03fa4b0bd08 = function(arg0, arg1) { getObject(arg0).deleteBuffer(getObject(arg1)); }; - imports.wbg.__wbg_deleteProgram_c6b502ab111ca429 = function(arg0, arg1) { + imports.wbg.__wbg_deleteProgram_53a32852f245b839 = function(arg0, arg1) { getObject(arg0).deleteProgram(getObject(arg1)); }; - imports.wbg.__wbg_deleteShader_cbb128151b8b2b6b = function(arg0, arg1) { + imports.wbg.__wbg_deleteShader_7c1222349324b5e2 = function(arg0, arg1) { getObject(arg0).deleteShader(getObject(arg1)); }; - imports.wbg.__wbg_deleteTexture_43dcaa158a7a967b = function(arg0, arg1) { + imports.wbg.__wbg_deleteTexture_4fcfea73cd8f6214 = function(arg0, arg1) { getObject(arg0).deleteTexture(getObject(arg1)); }; - imports.wbg.__wbg_detachShader_10a74e43565974e2 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_detachShader_04abccd441871232 = function(arg0, arg1, arg2) { getObject(arg0).detachShader(getObject(arg1), getObject(arg2)); }; - imports.wbg.__wbg_disable_94431bed03515efb = function(arg0, arg1) { + imports.wbg.__wbg_disable_e02106ca6c7002d6 = function(arg0, arg1) { getObject(arg0).disable(arg1 >>> 0); }; - imports.wbg.__wbg_disableVertexAttribArray_6f95b891552695e8 = function(arg0, arg1) { + imports.wbg.__wbg_disableVertexAttribArray_6d57776c8f642f44 = function(arg0, arg1) { getObject(arg0).disableVertexAttribArray(arg1 >>> 0); }; - imports.wbg.__wbg_drawArrays_77814548b9e573f2 = function(arg0, arg1, arg2, arg3) { + imports.wbg.__wbg_drawArrays_c91ce3f736bf1f2a = function(arg0, arg1, arg2, arg3) { getObject(arg0).drawArrays(arg1 >>> 0, arg2, arg3); }; - imports.wbg.__wbg_drawElements_9eb2a38d09666d1f = function(arg0, arg1, arg2, arg3, arg4) { + imports.wbg.__wbg_drawElements_a9529eefaf2008bd = function(arg0, arg1, arg2, arg3, arg4) { getObject(arg0).drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4); }; - imports.wbg.__wbg_enable_b36ff5159bc88f3d = function(arg0, arg1) { + imports.wbg.__wbg_enable_195891416c520019 = function(arg0, arg1) { getObject(arg0).enable(arg1 >>> 0); }; - imports.wbg.__wbg_enableVertexAttribArray_7e45a67bd47ec1bc = function(arg0, arg1) { + imports.wbg.__wbg_enableVertexAttribArray_8804480c2ea0bb72 = function(arg0, arg1) { getObject(arg0).enableVertexAttribArray(arg1 >>> 0); }; - imports.wbg.__wbg_getAttribLocation_9fb8d1fcf1e79c7d = function(arg0, arg1, arg2, arg3) { + imports.wbg.__wbg_getAttribLocation_7dbdbad935433494 = function(arg0, arg1, arg2, arg3) { const ret = getObject(arg0).getAttribLocation(getObject(arg1), getStringFromWasm0(arg2, arg3)); return ret; }; - imports.wbg.__wbg_getError_1a05a504dbd2417e = function(arg0) { + imports.wbg.__wbg_getError_7191ad6ea53607fe = function(arg0) { const ret = getObject(arg0).getError(); return ret; }; - imports.wbg.__wbg_getExtension_6b00e2c6c766b6cb = function() { return handleError(function (arg0, arg1, arg2) { + imports.wbg.__wbg_getExtension_77909f6d51d49d4d = function() { return handleError(function (arg0, arg1, arg2) { const ret = getObject(arg0).getExtension(getStringFromWasm0(arg1, arg2)); return isLikeNone(ret) ? 0 : addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_getParameter_9e1070be2e213377 = function() { return handleError(function (arg0, arg1) { + imports.wbg.__wbg_getParameter_55b36a787dbbfb74 = function() { return handleError(function (arg0, arg1) { const ret = getObject(arg0).getParameter(arg1 >>> 0); return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_getProgramInfoLog_03d7941c48fa9179 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_getProgramInfoLog_b81bc53188e286fa = function(arg0, arg1, arg2) { const ret = getObject(arg1).getProgramInfoLog(getObject(arg2)); var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len1 = WASM_VECTOR_LEN; getInt32Memory0()[arg0 / 4 + 1] = len1; getInt32Memory0()[arg0 / 4 + 0] = ptr1; }; - imports.wbg.__wbg_getProgramParameter_dd171792e4ba3184 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_getProgramParameter_35522a0bfdfaad27 = function(arg0, arg1, arg2) { const ret = getObject(arg0).getProgramParameter(getObject(arg1), arg2 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbg_getShaderInfoLog_c1cca646bf94aa17 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_getShaderInfoLog_968b93e75477d725 = function(arg0, arg1, arg2) { const ret = getObject(arg1).getShaderInfoLog(getObject(arg2)); var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len1 = WASM_VECTOR_LEN; getInt32Memory0()[arg0 / 4 + 1] = len1; getInt32Memory0()[arg0 / 4 + 0] = ptr1; }; - imports.wbg.__wbg_getShaderParameter_c1d89b570b67be37 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_getShaderParameter_ac2727ae4fe7648e = function(arg0, arg1, arg2) { const ret = getObject(arg0).getShaderParameter(getObject(arg1), arg2 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbg_getSupportedExtensions_675e4373f0fe08ca = function(arg0) { + imports.wbg.__wbg_getSupportedExtensions_fafc31aab913037d = function(arg0) { const ret = getObject(arg0).getSupportedExtensions(); return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_getUniformLocation_984bcb57f0539335 = function(arg0, arg1, arg2, arg3) { + imports.wbg.__wbg_getUniformLocation_9f6eb60c560a347b = function(arg0, arg1, arg2, arg3) { const ret = getObject(arg0).getUniformLocation(getObject(arg1), getStringFromWasm0(arg2, arg3)); return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_linkProgram_0a25df9d4086c8c9 = function(arg0, arg1) { + imports.wbg.__wbg_linkProgram_33998194075d71fb = function(arg0, arg1) { getObject(arg0).linkProgram(getObject(arg1)); }; - imports.wbg.__wbg_pixelStorei_2a2698776f2da87a = function(arg0, arg1, arg2) { + imports.wbg.__wbg_pixelStorei_f3a24990aa352fc7 = function(arg0, arg1, arg2) { getObject(arg0).pixelStorei(arg1 >>> 0, arg2); }; - imports.wbg.__wbg_scissor_5bbf5da585fcd6cd = function(arg0, arg1, arg2, arg3, arg4) { + imports.wbg.__wbg_scissor_e8e41e1c0a9817c8 = function(arg0, arg1, arg2, arg3, arg4) { getObject(arg0).scissor(arg1, arg2, arg3, arg4); }; - imports.wbg.__wbg_shaderSource_5c55ce208ee2dc38 = function(arg0, arg1, arg2, arg3) { + imports.wbg.__wbg_shaderSource_1cb7c64dc7d1a500 = function(arg0, arg1, arg2, arg3) { getObject(arg0).shaderSource(getObject(arg1), getStringFromWasm0(arg2, arg3)); }; - imports.wbg.__wbg_texParameteri_05700ca575d5f41d = function(arg0, arg1, arg2, arg3) { + imports.wbg.__wbg_texParameteri_85dad939f62a15aa = function(arg0, arg1, arg2, arg3) { getObject(arg0).texParameteri(arg1 >>> 0, arg2 >>> 0, arg3); }; - imports.wbg.__wbg_uniform1f_51ae9c9d19ab2a9e = function(arg0, arg1, arg2) { + imports.wbg.__wbg_uniform1f_88379f4e2630bc66 = function(arg0, arg1, arg2) { getObject(arg0).uniform1f(getObject(arg1), arg2); }; - imports.wbg.__wbg_uniform1i_ef0ff3d67b59f4de = function(arg0, arg1, arg2) { + imports.wbg.__wbg_uniform1i_d2e61a6a43889648 = function(arg0, arg1, arg2) { getObject(arg0).uniform1i(getObject(arg1), arg2); }; - imports.wbg.__wbg_uniform2f_7a195f76fb8bc260 = function(arg0, arg1, arg2, arg3) { + imports.wbg.__wbg_uniform2f_b6e484a1302ea599 = function(arg0, arg1, arg2, arg3) { getObject(arg0).uniform2f(getObject(arg1), arg2, arg3); }; - imports.wbg.__wbg_useProgram_f16b06e2ecdf168f = function(arg0, arg1) { + imports.wbg.__wbg_useProgram_3683cf6f60939dcd = function(arg0, arg1) { getObject(arg0).useProgram(getObject(arg1)); }; - imports.wbg.__wbg_vertexAttribPointer_c16280a7c840a534 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + imports.wbg.__wbg_vertexAttribPointer_316ffe2f0458fde7 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { getObject(arg0).vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6); }; - imports.wbg.__wbg_viewport_a79678835091995e = function(arg0, arg1, arg2, arg3, arg4) { + imports.wbg.__wbg_viewport_fad1ce9e18f741c0 = function(arg0, arg1, arg2, arg3, arg4) { getObject(arg0).viewport(arg1, arg2, arg3, arg4); }; - imports.wbg.__wbg_instanceof_Window_c5579e140698a9dc = function(arg0) { + imports.wbg.__wbg_instanceof_Window_9029196b662bc42a = function(arg0) { let result; try { result = getObject(arg0) instanceof Window; @@ -691,767 +691,129 @@ function __wbg_get_imports() { const ret = result; return ret; }; - imports.wbg.__wbg_document_508774c021174a52 = function(arg0) { + imports.wbg.__wbg_document_f7ace2b956f30a4f = function(arg0) { const ret = getObject(arg0).document; return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_location_f6c62a50e72200c8 = function(arg0) { + imports.wbg.__wbg_location_56243dba507f472d = function(arg0) { const ret = getObject(arg0).location; return addHeapObject(ret); }; - imports.wbg.__wbg_navigator_957c9b40d49df205 = function(arg0) { + imports.wbg.__wbg_navigator_7c9103698acde322 = function(arg0) { const ret = getObject(arg0).navigator; return addHeapObject(ret); }; - imports.wbg.__wbg_innerHeight_972bafa16334ae25 = function() { return handleError(function (arg0) { + imports.wbg.__wbg_innerHeight_2dd06d8cf68f1d7d = function() { return handleError(function (arg0) { const ret = getObject(arg0).innerHeight; return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_devicePixelRatio_027b47127fcabea6 = function(arg0) { + imports.wbg.__wbg_devicePixelRatio_f9de7bddca0eaf20 = function(arg0) { const ret = getObject(arg0).devicePixelRatio; return ret; }; - imports.wbg.__wbg_performance_01a75a1b70b2c191 = function(arg0) { + imports.wbg.__wbg_performance_2c295061c8b01e0b = function(arg0) { const ret = getObject(arg0).performance; return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_speechSynthesis_c411499eede06735 = function() { return handleError(function (arg0) { + imports.wbg.__wbg_speechSynthesis_58ae269ad6d93928 = function() { return handleError(function (arg0) { const ret = getObject(arg0).speechSynthesis; return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_localStorage_b5b6d3c826dbfeda = function() { return handleError(function (arg0) { + imports.wbg.__wbg_localStorage_dbac11bd189e9fa0 = function() { return handleError(function (arg0) { const ret = getObject(arg0).localStorage; return isLikeNone(ret) ? 0 : addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_matchMedia_0dd51eaa41e54a4a = function() { return handleError(function (arg0, arg1, arg2) { + imports.wbg.__wbg_matchMedia_12ef69056e32d0b3 = function() { return handleError(function (arg0, arg1, arg2) { const ret = getObject(arg0).matchMedia(getStringFromWasm0(arg1, arg2)); return isLikeNone(ret) ? 0 : addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_open_7403f38d13c728d5 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + imports.wbg.__wbg_open_7a2a86bf6285507d = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); return isLikeNone(ret) ? 0 : addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_requestAnimationFrame_d28701d8e57998d1 = function() { return handleError(function (arg0, arg1) { + imports.wbg.__wbg_requestAnimationFrame_d082200514b6674d = function() { return handleError(function (arg0, arg1) { const ret = getObject(arg0).requestAnimationFrame(getObject(arg1)); return ret; }, arguments) }; - imports.wbg.__wbg_clearInterval_c4c01544d0ea3996 = function(arg0, arg1) { + imports.wbg.__wbg_clearInterval_080a47b47538d08c = function(arg0, arg1) { getObject(arg0).clearInterval(arg1); }; - imports.wbg.__wbg_fetch_bb49ae9f1d79408b = function(arg0, arg1) { + imports.wbg.__wbg_fetch_336b6f0cb426b46e = function(arg0, arg1) { const ret = getObject(arg0).fetch(getObject(arg1)); return addHeapObject(ret); }; - imports.wbg.__wbg_setTimeout_a71432ae24261750 = function() { return handleError(function (arg0, arg1, arg2) { + imports.wbg.__wbg_setTimeout_eb1a0d116c26d9f6 = function() { return handleError(function (arg0, arg1, arg2) { const ret = getObject(arg0).setTimeout(getObject(arg1), arg2); return ret; }, arguments) }; - imports.wbg.__wbg_size_a058ca48cf388fd6 = function(arg0) { - const ret = getObject(arg0).size; - return ret; - }; - imports.wbg.__wbg_arrayBuffer_932c610fd9598bef = function(arg0) { - const ret = getObject(arg0).arrayBuffer(); - return addHeapObject(ret); - }; - imports.wbg.__wbg_type_a7d16081cac0a25b = function(arg0, arg1) { - const ret = getObject(arg1).type; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }; - imports.wbg.__wbg_voiceURI_1c374d1801636c26 = function(arg0, arg1) { - const ret = getObject(arg1).voiceURI; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }; - imports.wbg.__wbg_name_b85b3a3d45d797bf = function(arg0, arg1) { - const ret = getObject(arg1).name; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }; - imports.wbg.__wbg_lang_760dcdec80a6c745 = function(arg0, arg1) { - const ret = getObject(arg1).lang; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }; - imports.wbg.__wbg_default_e1aa2046d76cda57 = function(arg0) { - const ret = getObject(arg0).default; - return ret; - }; - imports.wbg.__wbg_top_7f927afdb53442c3 = function(arg0) { - const ret = getObject(arg0).top; - return ret; - }; - imports.wbg.__wbg_left_d363f2200ca7bca7 = function(arg0) { - const ret = getObject(arg0).left; - return ret; - }; - imports.wbg.__wbg_length_804062329ac4ddbb = function(arg0) { - const ret = getObject(arg0).length; - return ret; - }; - imports.wbg.__wbg_get_43359180ff298dda = function(arg0, arg1) { - const ret = getObject(arg0)[arg1 >>> 0]; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_bindVertexArrayOES_edb665af84add641 = function(arg0, arg1) { - getObject(arg0).bindVertexArrayOES(getObject(arg1)); - }; - imports.wbg.__wbg_createVertexArrayOES_72dc110fc4561db9 = function(arg0) { - const ret = getObject(arg0).createVertexArrayOES(); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_deleteVertexArrayOES_bb2f05cfcd49a758 = function(arg0, arg1) { - getObject(arg0).deleteVertexArrayOES(getObject(arg1)); - }; - imports.wbg.__wbg_now_c97f243e7947c4ac = function(arg0) { - const ret = getObject(arg0).now(); - return ret; - }; - imports.wbg.__wbg_instanceof_Response_7ade9a5a066d1a55 = function(arg0) { - let result; - try { - result = getObject(arg0) instanceof Response; - } catch { - result = false; - } - const ret = result; - return ret; - }; - imports.wbg.__wbg_url_59cb32ef6a837521 = function(arg0, arg1) { - const ret = getObject(arg1).url; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }; - imports.wbg.__wbg_status_d2b2d0889f7e970f = function(arg0) { - const ret = getObject(arg0).status; - return ret; - }; - imports.wbg.__wbg_ok_0a0ed9a1863d8af5 = function(arg0) { - const ret = getObject(arg0).ok; - return ret; - }; - imports.wbg.__wbg_statusText_3600c56ee3873605 = function(arg0, arg1) { - const ret = getObject(arg1).statusText; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }; - imports.wbg.__wbg_headers_2de03c88f895093b = function(arg0) { - const ret = getObject(arg0).headers; - return addHeapObject(ret); - }; - imports.wbg.__wbg_arrayBuffer_2693673868da65b7 = function() { return handleError(function (arg0) { - const ret = getObject(arg0).arrayBuffer(); - return addHeapObject(ret); - }, arguments) }; - imports.wbg.__wbg_length_e9385289cac41215 = function(arg0) { - const ret = getObject(arg0).length; - return ret; - }; - imports.wbg.__wbg_item_3ce7f6824dd8c355 = function(arg0, arg1) { - const ret = getObject(arg0).item(arg1 >>> 0); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_get_969f46cb0fad92dc = function(arg0, arg1) { - const ret = getObject(arg0)[arg1 >>> 0]; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_deltaX_0e9fe84a3998df5e = function(arg0) { - const ret = getObject(arg0).deltaX; - return ret; - }; - imports.wbg.__wbg_deltaY_c24e1c19542b4ba4 = function(arg0) { - const ret = getObject(arg0).deltaY; - return ret; - }; - imports.wbg.__wbg_deltaMode_998c8ea939f3998a = function(arg0) { - const ret = getObject(arg0).deltaMode; - return ret; - }; - imports.wbg.__wbg_width_3f3962bb2721e365 = function(arg0) { - const ret = getObject(arg0).width; - return ret; - }; - imports.wbg.__wbg_height_32cf02a714d68bd4 = function(arg0) { - const ret = getObject(arg0).height; - return ret; - }; - imports.wbg.__wbg_addEventListener_d25d1ffe6c69ae96 = function() { return handleError(function (arg0, arg1, arg2, arg3) { - getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); - }, arguments) }; - imports.wbg.__wbg_removeEventListener_7a381df5fdb6037f = function() { return handleError(function (arg0, arg1, arg2, arg3) { - getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); - }, arguments) }; - imports.wbg.__wbg_clientX_7ffcce9d4cf5ed8f = function(arg0) { - const ret = getObject(arg0).clientX; - return ret; - }; - imports.wbg.__wbg_clientY_2340b057451d96fb = function(arg0) { - const ret = getObject(arg0).clientY; - return ret; - }; - imports.wbg.__wbg_ctrlKey_1c15f65d527fd45e = function(arg0) { - const ret = getObject(arg0).ctrlKey; - return ret; - }; - imports.wbg.__wbg_shiftKey_1a7bf1612681d447 = function(arg0) { - const ret = getObject(arg0).shiftKey; - return ret; - }; - imports.wbg.__wbg_metaKey_3c7419a9d32c95d1 = function(arg0) { - const ret = getObject(arg0).metaKey; - return ret; - }; - imports.wbg.__wbg_button_88e86c8fe3039068 = function(arg0) { - const ret = getObject(arg0).button; - return ret; - }; - imports.wbg.__wbg_error_49c7bf770cd75883 = function(arg0) { - const ret = getObject(arg0).error; - return addHeapObject(ret); - }; - imports.wbg.__wbg_instanceof_HtmlCanvasElement_b2dfeaf97587c9fa = function(arg0) { - let result; - try { - result = getObject(arg0) instanceof HTMLCanvasElement; - } catch { - result = false; - } - const ret = result; - return ret; - }; - imports.wbg.__wbg_width_b1f2559ce447b1d9 = function(arg0) { - const ret = getObject(arg0).width; - return ret; - }; - imports.wbg.__wbg_setwidth_196f4382488fd119 = function(arg0, arg1) { - getObject(arg0).width = arg1 >>> 0; - }; - imports.wbg.__wbg_height_0d9fffc5de313208 = function(arg0) { - const ret = getObject(arg0).height; - return ret; - }; - imports.wbg.__wbg_setheight_6d295d03e1783969 = function(arg0, arg1) { - getObject(arg0).height = arg1 >>> 0; - }; - imports.wbg.__wbg_getContext_24464d6344024525 = function() { return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2)); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }, arguments) }; - imports.wbg.__wbg_matches_de64b7bec89b21e4 = function(arg0) { - const ret = getObject(arg0).matches; - return ret; - }; - imports.wbg.__wbg_matches_03fa716e6d77d76f = function(arg0) { - const ret = getObject(arg0).matches; - return ret; - }; - imports.wbg.__wbg_writeText_f3c15480e7666d78 = function(arg0, arg1, arg2) { - const ret = getObject(arg0).writeText(getStringFromWasm0(arg1, arg2)); - return addHeapObject(ret); - }; - imports.wbg.__wbg_items_577e171b04c9aaa9 = function(arg0) { - const ret = getObject(arg0).items; - return addHeapObject(ret); - }; - imports.wbg.__wbg_files_7ce5634e8bc25a85 = function(arg0) { - const ret = getObject(arg0).files; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_getData_f586c0811a7ec1c4 = function() { return handleError(function (arg0, arg1, arg2, arg3) { - const ret = getObject(arg1).getData(getStringFromWasm0(arg2, arg3)); - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }, arguments) }; - imports.wbg.__wbg_name_ae233a503e60a8f9 = function(arg0, arg1) { - const ret = getObject(arg1).name; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }; - imports.wbg.__wbg_lastModified_75062097476be87c = function(arg0) { - const ret = getObject(arg0).lastModified; - return ret; - }; - imports.wbg.__wbg_keyCode_48193538ac21d5a4 = function(arg0) { - const ret = getObject(arg0).keyCode; - return ret; - }; - imports.wbg.__wbg_altKey_1796184c5e96a92b = function(arg0) { - const ret = getObject(arg0).altKey; - return ret; - }; - imports.wbg.__wbg_ctrlKey_a6ae383772af67d4 = function(arg0) { - const ret = getObject(arg0).ctrlKey; - return ret; - }; - imports.wbg.__wbg_shiftKey_0b1fd10d0674f847 = function(arg0) { - const ret = getObject(arg0).shiftKey; - return ret; - }; - imports.wbg.__wbg_metaKey_e6e67f783888f56d = function(arg0) { - const ret = getObject(arg0).metaKey; - return ret; - }; - imports.wbg.__wbg_isComposing_11821d1699a0901e = function(arg0) { - const ret = getObject(arg0).isComposing; - return ret; - }; - imports.wbg.__wbg_key_2e1ec0c70a342064 = function(arg0, arg1) { - const ret = getObject(arg1).key; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }; - imports.wbg.__wbg_clipboard_4685056afb1bd02b = function(arg0) { - const ret = getObject(arg0).clipboard; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_userAgent_cda809ba30048ef3 = function() { return handleError(function (arg0, arg1) { - const ret = getObject(arg1).userAgent; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }, arguments) }; - imports.wbg.__wbg_headers_1eff4f53324496e6 = function(arg0) { - const ret = getObject(arg0).headers; - return addHeapObject(ret); - }; - imports.wbg.__wbg_newwithstrandinit_a4cd16dfaafcf625 = function() { return handleError(function (arg0, arg1, arg2) { - const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2)); - return addHeapObject(ret); - }, arguments) }; - imports.wbg.__wbg_body_db30cc67afcfce41 = function(arg0) { - const ret = getObject(arg0).body; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_createElement_d975e66d06bc88da = function() { return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2)); - return addHeapObject(ret); - }, arguments) }; - imports.wbg.__wbg_getElementById_2d1ad15c49298068 = function(arg0, arg1, arg2) { - const ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2)); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_setid_7b804eee26ac1f4c = function(arg0, arg1, arg2) { - getObject(arg0).id = getStringFromWasm0(arg1, arg2); - }; - imports.wbg.__wbg_scrollLeft_d414f3347b1709bf = function(arg0) { - const ret = getObject(arg0).scrollLeft; - return ret; - }; - imports.wbg.__wbg_clientWidth_28c68ca0ee754d86 = function(arg0) { - const ret = getObject(arg0).clientWidth; - return ret; - }; - imports.wbg.__wbg_clientHeight_fdbd966f05f13573 = function(arg0) { - const ret = getObject(arg0).clientHeight; - return ret; - }; - imports.wbg.__wbg_getBoundingClientRect_89e65d65040347e7 = function(arg0) { - const ret = getObject(arg0).getBoundingClientRect(); - return addHeapObject(ret); - }; - imports.wbg.__wbg_scrollTop_073ecc1ed0e30723 = function(arg0) { - const ret = getObject(arg0).scrollTop; - return ret; - }; - imports.wbg.__wbg_hidden_6e9683fc743723b7 = function(arg0) { - const ret = getObject(arg0).hidden; - return ret; - }; - imports.wbg.__wbg_sethidden_253d3f6b07efe62c = function(arg0, arg1) { - getObject(arg0).hidden = arg1 !== 0; - }; - imports.wbg.__wbg_style_6bc91a563e84d432 = function(arg0) { - const ret = getObject(arg0).style; - return addHeapObject(ret); - }; - imports.wbg.__wbg_offsetTop_19bb0e1c142f9499 = function(arg0) { - const ret = getObject(arg0).offsetTop; - return ret; - }; - imports.wbg.__wbg_offsetLeft_677c5033ce585ad4 = function(arg0) { - const ret = getObject(arg0).offsetLeft; - return ret; - }; - imports.wbg.__wbg_offsetWidth_20880536c835f478 = function(arg0) { - const ret = getObject(arg0).offsetWidth; - return ret; - }; - imports.wbg.__wbg_blur_c2d062c40054c68d = function() { return handleError(function (arg0) { - getObject(arg0).blur(); - }, arguments) }; - imports.wbg.__wbg_focus_6baebc9f44af9925 = function() { return handleError(function (arg0) { - getObject(arg0).focus(); - }, arguments) }; - imports.wbg.__wbg_instanceof_WebGlRenderingContext_e1419556cd2b2d2d = function(arg0) { - let result; - try { - result = getObject(arg0) instanceof WebGLRenderingContext; - } catch { - result = false; - } - const ret = result; - return ret; - }; - imports.wbg.__wbg_bufferData_bf07fdd88f2e61a0 = function(arg0, arg1, arg2, arg3) { - getObject(arg0).bufferData(arg1 >>> 0, getObject(arg2), arg3 >>> 0); - }; - imports.wbg.__wbg_texImage2D_b23cc3496d4c8934 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { - getObject(arg0).texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, getObject(arg9)); - }, arguments) }; - imports.wbg.__wbg_texSubImage2D_3393b2faf4bdeda7 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { - getObject(arg0).texSubImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, getObject(arg9)); - }, arguments) }; - imports.wbg.__wbg_activeTexture_b191924c363f77ce = function(arg0, arg1) { - getObject(arg0).activeTexture(arg1 >>> 0); - }; - imports.wbg.__wbg_attachShader_c6ba0e94024fcfd3 = function(arg0, arg1, arg2) { - getObject(arg0).attachShader(getObject(arg1), getObject(arg2)); - }; - imports.wbg.__wbg_bindBuffer_bc746e5757cfd27a = function(arg0, arg1, arg2) { - getObject(arg0).bindBuffer(arg1 >>> 0, getObject(arg2)); - }; - imports.wbg.__wbg_bindTexture_003e92d5bd3d1cc7 = function(arg0, arg1, arg2) { - getObject(arg0).bindTexture(arg1 >>> 0, getObject(arg2)); - }; - imports.wbg.__wbg_blendEquationSeparate_c22d96f84170b893 = function(arg0, arg1, arg2) { - getObject(arg0).blendEquationSeparate(arg1 >>> 0, arg2 >>> 0); - }; - imports.wbg.__wbg_blendFuncSeparate_060a21922823f86f = function(arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).blendFuncSeparate(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0); - }; - imports.wbg.__wbg_clear_0fbd94f2b3007978 = function(arg0, arg1) { - getObject(arg0).clear(arg1 >>> 0); - }; - imports.wbg.__wbg_clearColor_a72825467905e9d1 = function(arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).clearColor(arg1, arg2, arg3, arg4); - }; - imports.wbg.__wbg_colorMask_8154d2f1a5eb697a = function(arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).colorMask(arg1 !== 0, arg2 !== 0, arg3 !== 0, arg4 !== 0); - }; - imports.wbg.__wbg_compileShader_11deea085b781c35 = function(arg0, arg1) { - getObject(arg0).compileShader(getObject(arg1)); - }; - imports.wbg.__wbg_createBuffer_d90b963a9701a002 = function(arg0) { - const ret = getObject(arg0).createBuffer(); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_createProgram_d78c1ab5ce988d0a = function(arg0) { - const ret = getObject(arg0).createProgram(); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_createShader_94cce4c7315d3927 = function(arg0, arg1) { - const ret = getObject(arg0).createShader(arg1 >>> 0); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_createTexture_ae9908092d6ebd13 = function(arg0) { - const ret = getObject(arg0).createTexture(); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_deleteBuffer_10e438f4de8bbdd0 = function(arg0, arg1) { - getObject(arg0).deleteBuffer(getObject(arg1)); - }; - imports.wbg.__wbg_deleteProgram_71b202b504e08521 = function(arg0, arg1) { - getObject(arg0).deleteProgram(getObject(arg1)); - }; - imports.wbg.__wbg_deleteShader_91b6949c2cb57fa5 = function(arg0, arg1) { - getObject(arg0).deleteShader(getObject(arg1)); - }; - imports.wbg.__wbg_deleteTexture_89b7cefee5715eaf = function(arg0, arg1) { - getObject(arg0).deleteTexture(getObject(arg1)); - }; - imports.wbg.__wbg_detachShader_619bf2d58c955ff2 = function(arg0, arg1, arg2) { - getObject(arg0).detachShader(getObject(arg1), getObject(arg2)); - }; - imports.wbg.__wbg_disable_18e601ffe079514a = function(arg0, arg1) { - getObject(arg0).disable(arg1 >>> 0); - }; - imports.wbg.__wbg_disableVertexAttribArray_eebd7bbc31fe8477 = function(arg0, arg1) { - getObject(arg0).disableVertexAttribArray(arg1 >>> 0); - }; - imports.wbg.__wbg_drawArrays_fa797947fad0d5a1 = function(arg0, arg1, arg2, arg3) { - getObject(arg0).drawArrays(arg1 >>> 0, arg2, arg3); - }; - imports.wbg.__wbg_drawElements_f61f3169f51e95a8 = function(arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4); - }; - imports.wbg.__wbg_enable_933052fc623337dd = function(arg0, arg1) { - getObject(arg0).enable(arg1 >>> 0); - }; - imports.wbg.__wbg_enableVertexAttribArray_085d700612de8362 = function(arg0, arg1) { - getObject(arg0).enableVertexAttribArray(arg1 >>> 0); - }; - imports.wbg.__wbg_getAttribLocation_019759a318602415 = function(arg0, arg1, arg2, arg3) { - const ret = getObject(arg0).getAttribLocation(getObject(arg1), getStringFromWasm0(arg2, arg3)); - return ret; - }; - imports.wbg.__wbg_getError_ffde7e40a0075b63 = function(arg0) { - const ret = getObject(arg0).getError(); - return ret; - }; - imports.wbg.__wbg_getExtension_ffc1bd6e864d6abe = function() { return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).getExtension(getStringFromWasm0(arg1, arg2)); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }, arguments) }; - imports.wbg.__wbg_getParameter_211f7166414ae1d2 = function() { return handleError(function (arg0, arg1) { - const ret = getObject(arg0).getParameter(arg1 >>> 0); - return addHeapObject(ret); - }, arguments) }; - imports.wbg.__wbg_getProgramInfoLog_e9101bb2902f723d = function(arg0, arg1, arg2) { - const ret = getObject(arg1).getProgramInfoLog(getObject(arg2)); - var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }; - imports.wbg.__wbg_getProgramParameter_2b03f89296b12b4b = function(arg0, arg1, arg2) { - const ret = getObject(arg0).getProgramParameter(getObject(arg1), arg2 >>> 0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_getShaderInfoLog_311c033a58aeed83 = function(arg0, arg1, arg2) { - const ret = getObject(arg1).getShaderInfoLog(getObject(arg2)); - var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }; - imports.wbg.__wbg_getShaderParameter_0003e598f392b3f6 = function(arg0, arg1, arg2) { - const ret = getObject(arg0).getShaderParameter(getObject(arg1), arg2 >>> 0); - return addHeapObject(ret); - }; - imports.wbg.__wbg_getSupportedExtensions_642c7d68066b573c = function(arg0) { - const ret = getObject(arg0).getSupportedExtensions(); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_getUniformLocation_90a9c5e63646d30f = function(arg0, arg1, arg2, arg3) { - const ret = getObject(arg0).getUniformLocation(getObject(arg1), getStringFromWasm0(arg2, arg3)); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_linkProgram_12cc552bbaf3fcd8 = function(arg0, arg1) { - getObject(arg0).linkProgram(getObject(arg1)); - }; - imports.wbg.__wbg_pixelStorei_673b59ca3de9bf71 = function(arg0, arg1, arg2) { - getObject(arg0).pixelStorei(arg1 >>> 0, arg2); - }; - imports.wbg.__wbg_scissor_d6dd0b6d33070a27 = function(arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).scissor(arg1, arg2, arg3, arg4); - }; - imports.wbg.__wbg_shaderSource_be3c868a31ce0a63 = function(arg0, arg1, arg2, arg3) { - getObject(arg0).shaderSource(getObject(arg1), getStringFromWasm0(arg2, arg3)); - }; - imports.wbg.__wbg_texParameteri_8a613af30322a029 = function(arg0, arg1, arg2, arg3) { - getObject(arg0).texParameteri(arg1 >>> 0, arg2 >>> 0, arg3); - }; - imports.wbg.__wbg_uniform1f_47b794fe461d672a = function(arg0, arg1, arg2) { - getObject(arg0).uniform1f(getObject(arg1), arg2); - }; - imports.wbg.__wbg_uniform1i_eb9e0e57747e2b87 = function(arg0, arg1, arg2) { - getObject(arg0).uniform1i(getObject(arg1), arg2); - }; - imports.wbg.__wbg_uniform2f_75d4cb678b6f0e13 = function(arg0, arg1, arg2, arg3) { - getObject(arg0).uniform2f(getObject(arg1), arg2, arg3); - }; - imports.wbg.__wbg_useProgram_72ab2082025590d6 = function(arg0, arg1) { - getObject(arg0).useProgram(getObject(arg1)); - }; - imports.wbg.__wbg_vertexAttribPointer_39284763b38d2a03 = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { - getObject(arg0).vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6); - }; - imports.wbg.__wbg_viewport_d7c73a71f08f3aa1 = function(arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).viewport(arg1, arg2, arg3, arg4); - }; - imports.wbg.__wbg_data_64c5449b2adfdff6 = function(arg0, arg1) { + imports.wbg.__wbg_data_03708a776af7d2f6 = function(arg0, arg1) { const ret = getObject(arg1).data; var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len1 = WASM_VECTOR_LEN; getInt32Memory0()[arg0 / 4 + 1] = len1; getInt32Memory0()[arg0 / 4 + 0] = ptr1; }; - imports.wbg.__wbg_setProperty_0a5af0fd1a9e8e25 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).setProperty(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); - }, arguments) }; - imports.wbg.__wbg_length_bff46949c967d66a = function(arg0) { + imports.wbg.__wbg_width_e0c6b79d8cdd8897 = function(arg0) { + const ret = getObject(arg0).width; + return ret; + }; + imports.wbg.__wbg_height_bed51746e072a118 = function(arg0) { + const ret = getObject(arg0).height; + return ret; + }; + imports.wbg.__wbg_length_b941879633a63ad8 = function(arg0) { const ret = getObject(arg0).length; return ret; }; - imports.wbg.__wbg_get_277c616d81e49f73 = function(arg0, arg1) { + imports.wbg.__wbg_get_b383d7f8253c2d61 = function(arg0, arg1) { const ret = getObject(arg0)[arg1 >>> 0]; return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_dataTransfer_87da4b5e2c2e3bc4 = function(arg0) { - const ret = getObject(arg0).dataTransfer; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_parentElement_065722829508e41a = function(arg0) { - const ret = getObject(arg0).parentElement; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_appendChild_1139b53a65d69bed = function() { return handleError(function (arg0, arg1) { - const ret = getObject(arg0).appendChild(getObject(arg1)); - return addHeapObject(ret); - }, arguments) }; - imports.wbg.__wbg_speaking_e166a6e6cd16926d = function(arg0) { - const ret = getObject(arg0).speaking; - return ret; - }; - imports.wbg.__wbg_cancel_2fd875e685342a41 = function(arg0) { - getObject(arg0).cancel(); - }; - imports.wbg.__wbg_getVoices_769c317b57ab4d62 = function(arg0) { - const ret = getObject(arg0).getVoices(); - return addHeapObject(ret); - }; - imports.wbg.__wbg_speak_79ff59113028b505 = function(arg0, arg1) { - getObject(arg0).speak(getObject(arg1)); - }; - imports.wbg.__wbg_preventDefault_2f38e1471796356f = function(arg0) { - getObject(arg0).preventDefault(); - }; - imports.wbg.__wbg_stopPropagation_5df9f972a70ef515 = function(arg0) { - getObject(arg0).stopPropagation(); - }; - imports.wbg.__wbg_href_68df54cac0a34be4 = function() { return handleError(function (arg0, arg1) { - const ret = getObject(arg1).href; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }, arguments) }; - imports.wbg.__wbg_origin_ab6836ac8535fbb2 = function() { return handleError(function (arg0, arg1) { - const ret = getObject(arg1).origin; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }, arguments) }; - imports.wbg.__wbg_protocol_68c51e1c422d4ab9 = function() { return handleError(function (arg0, arg1) { - const ret = getObject(arg1).protocol; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }, arguments) }; - imports.wbg.__wbg_host_e72469b40dce950f = function() { return handleError(function (arg0, arg1) { - const ret = getObject(arg1).host; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }, arguments) }; - imports.wbg.__wbg_hostname_d253c57e7fa779ea = function() { return handleError(function (arg0, arg1) { - const ret = getObject(arg1).hostname; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }, arguments) }; - imports.wbg.__wbg_port_33d51963fa5f980d = function() { return handleError(function (arg0, arg1) { - const ret = getObject(arg1).port; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }, arguments) }; - imports.wbg.__wbg_search_41ecfaf18d054732 = function() { return handleError(function (arg0, arg1) { - const ret = getObject(arg1).search; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }, arguments) }; - imports.wbg.__wbg_hash_afd040db1cf05017 = function() { return handleError(function (arg0, arg1) { - const ret = getObject(arg1).hash; - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }, arguments) }; - imports.wbg.__wbg_touches_08fba6286bed8021 = function(arg0) { - const ret = getObject(arg0).touches; - return addHeapObject(ret); - }; - imports.wbg.__wbg_changedTouches_0e21b77cd9200e74 = function(arg0) { - const ret = getObject(arg0).changedTouches; - return addHeapObject(ret); - }; - imports.wbg.__wbg_clipboardData_84b041aaf1dd9a2c = function(arg0) { - const ret = getObject(arg0).clipboardData; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__wbg_set_76353df4722f4954 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + imports.wbg.__wbg_set_b34caba58723c454 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); }, arguments) }; - imports.wbg.__wbg_setvoice_b89f15aafa327ee8 = function(arg0, arg1) { + imports.wbg.__wbg_error_bd8f2b9a1955400c = function(arg0) { + const ret = getObject(arg0).error; + return addHeapObject(ret); + }; + imports.wbg.__wbg_setvoice_1cdf4f6a91b1cc6d = function(arg0, arg1) { getObject(arg0).voice = getObject(arg1); }; - imports.wbg.__wbg_setvolume_b175e9ad36c878ee = function(arg0, arg1) { + imports.wbg.__wbg_setvolume_9ce6fa0115fb0261 = function(arg0, arg1) { getObject(arg0).volume = arg1; }; - imports.wbg.__wbg_setrate_ca2167dc6b346b26 = function(arg0, arg1) { + imports.wbg.__wbg_setrate_3cb16d28a89a549c = function(arg0, arg1) { getObject(arg0).rate = arg1; }; - imports.wbg.__wbg_setpitch_3a330092e7e9b96f = function(arg0, arg1) { + imports.wbg.__wbg_setpitch_8bf2e2409e1707df = function(arg0, arg1) { getObject(arg0).pitch = arg1; }; - imports.wbg.__wbg_setonstart_963d173442cf886e = function(arg0, arg1) { + imports.wbg.__wbg_setonstart_d67a423413afcc19 = function(arg0, arg1) { getObject(arg0).onstart = getObject(arg1); }; - imports.wbg.__wbg_setonend_1fea8ae30b203c54 = function(arg0, arg1) { + imports.wbg.__wbg_setonend_d777c00af811a8d0 = function(arg0, arg1) { getObject(arg0).onend = getObject(arg1); }; - imports.wbg.__wbg_setonerror_c117a28570d46684 = function(arg0, arg1) { + imports.wbg.__wbg_setonerror_3419fd51cfc38793 = function(arg0, arg1) { getObject(arg0).onerror = getObject(arg1); }; - imports.wbg.__wbg_newwithtext_8130d0159088eaf8 = function() { return handleError(function (arg0, arg1) { + imports.wbg.__wbg_newwithtext_7319093976235888 = function() { return handleError(function (arg0, arg1) { const ret = new SpeechSynthesisUtterance(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_getItem_84095995ffbc84fc = function() { return handleError(function (arg0, arg1, arg2, arg3) { - const ret = getObject(arg1).getItem(getStringFromWasm0(arg2, arg3)); - var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; - }, arguments) }; - imports.wbg.__wbg_setItem_e9a65f0e6892d9c9 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { - getObject(arg0).setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); - }, arguments) }; - imports.wbg.__wbg_identifier_bcd0d7d8565303c9 = function(arg0) { - const ret = getObject(arg0).identifier; + imports.wbg.__wbg_length_25c4aaeba8cfcc81 = function(arg0) { + const ret = getObject(arg0).length; return ret; }; - imports.wbg.__wbg_pageX_da46b41c74531c31 = function(arg0) { - const ret = getObject(arg0).pageX; - return ret; + imports.wbg.__wbg_item_59a092aa0f27eab6 = function(arg0, arg1) { + const ret = getObject(arg0).item(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_pageY_1a5658948b63f9ed = function(arg0) { - const ret = getObject(arg0).pageY; - return ret; + imports.wbg.__wbg_get_d6c4e69528650af4 = function(arg0, arg1) { + const ret = getObject(arg0)[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addHeapObject(ret); }; - imports.wbg.__wbg_force_77bad74f81971385 = function(arg0) { - const ret = getObject(arg0).force; - return ret; - }; - imports.wbg.__wbg_instanceof_HtmlInputElement_a15913e00980dd9c = function(arg0) { + imports.wbg.__wbg_instanceof_HtmlInputElement_31b50e0cf542c524 = function(arg0) { let result; try { result = getObject(arg0) instanceof HTMLInputElement; @@ -1461,27 +823,665 @@ function __wbg_get_imports() { const ret = result; return ret; }; - imports.wbg.__wbg_setautofocus_ae682319cc846b47 = function(arg0, arg1) { + imports.wbg.__wbg_setautofocus_61b6a31b4866ad1f = function(arg0, arg1) { getObject(arg0).autofocus = arg1 !== 0; }; - imports.wbg.__wbg_setsize_ae008b7511e35484 = function(arg0, arg1) { + imports.wbg.__wbg_setsize_7532844e2c9f5e10 = function(arg0, arg1) { getObject(arg0).size = arg1 >>> 0; }; - imports.wbg.__wbg_value_09d384cba1c51c6f = function(arg0, arg1) { + imports.wbg.__wbg_value_9423da9d988ee8cf = function(arg0, arg1) { const ret = getObject(arg1).value; const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len1 = WASM_VECTOR_LEN; getInt32Memory0()[arg0 / 4 + 1] = len1; getInt32Memory0()[arg0 / 4 + 0] = ptr1; }; - imports.wbg.__wbg_setvalue_7605619324f70225 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_setvalue_1f95e61cbc382f7f = function(arg0, arg1, arg2) { getObject(arg0).value = getStringFromWasm0(arg1, arg2); }; - imports.wbg.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) { + imports.wbg.__wbg_type_9f716e985ca0633c = function(arg0, arg1) { + const ret = getObject(arg1).type; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_clientX_1a480606ab0cabaa = function(arg0) { + const ret = getObject(arg0).clientX; + return ret; + }; + imports.wbg.__wbg_clientY_9c7878f7faf3900f = function(arg0) { + const ret = getObject(arg0).clientY; + return ret; + }; + imports.wbg.__wbg_ctrlKey_0a805df688b5bf42 = function(arg0) { + const ret = getObject(arg0).ctrlKey; + return ret; + }; + imports.wbg.__wbg_shiftKey_8a070ab6169b5fa4 = function(arg0) { + const ret = getObject(arg0).shiftKey; + return ret; + }; + imports.wbg.__wbg_metaKey_d89287be4389a3c1 = function(arg0) { + const ret = getObject(arg0).metaKey; + return ret; + }; + imports.wbg.__wbg_button_7a095234b69de930 = function(arg0) { + const ret = getObject(arg0).button; + return ret; + }; + imports.wbg.__wbg_instanceof_Response_fc4327dbfcdf5ced = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Response; + } catch { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_url_8503de97f69da463 = function(arg0, arg1) { + const ret = getObject(arg1).url; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_status_ac85a3142a84caa2 = function(arg0) { + const ret = getObject(arg0).status; + return ret; + }; + imports.wbg.__wbg_ok_e3d8d84e630fd064 = function(arg0) { + const ret = getObject(arg0).ok; + return ret; + }; + imports.wbg.__wbg_statusText_1dd32f6c94d79ef0 = function(arg0, arg1) { + const ret = getObject(arg1).statusText; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_headers_b70de86b8e989bc0 = function(arg0) { + const ret = getObject(arg0).headers; + return addHeapObject(ret); + }; + imports.wbg.__wbg_arrayBuffer_288fb3538806e85c = function() { return handleError(function (arg0) { + const ret = getObject(arg0).arrayBuffer(); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_deltaX_84508d00a1050e70 = function(arg0) { + const ret = getObject(arg0).deltaX; + return ret; + }; + imports.wbg.__wbg_deltaY_64823169afb0335d = function(arg0) { + const ret = getObject(arg0).deltaY; + return ret; + }; + imports.wbg.__wbg_deltaMode_1c680147cfdba8a5 = function(arg0) { + const ret = getObject(arg0).deltaMode; + return ret; + }; + imports.wbg.__wbg_bindVertexArrayOES_b7d9da7e073aa6b5 = function(arg0, arg1) { + getObject(arg0).bindVertexArrayOES(getObject(arg1)); + }; + imports.wbg.__wbg_createVertexArrayOES_6a3c3a5a68201f8f = function(arg0) { + const ret = getObject(arg0).createVertexArrayOES(); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_deleteVertexArrayOES_7bf4589e63d84df6 = function(arg0, arg1) { + getObject(arg0).deleteVertexArrayOES(getObject(arg1)); + }; + imports.wbg.__wbg_voiceURI_64621a744591aba3 = function(arg0, arg1) { + const ret = getObject(arg1).voiceURI; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_name_0429be7b00828d24 = function(arg0, arg1) { + const ret = getObject(arg1).name; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_lang_3a66cb1ce82d3781 = function(arg0, arg1) { + const ret = getObject(arg1).lang; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_default_d943dbf9175dc6cd = function(arg0) { + const ret = getObject(arg0).default; + return ret; + }; + imports.wbg.__wbg_addEventListener_5651108fc3ffeb6e = function() { return handleError(function (arg0, arg1, arg2, arg3) { + getObject(arg0).addEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); + }, arguments) }; + imports.wbg.__wbg_removeEventListener_5de660c02ed784e4 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + getObject(arg0).removeEventListener(getStringFromWasm0(arg1, arg2), getObject(arg3)); + }, arguments) }; + imports.wbg.__wbg_now_0cfdc90c97d0c24b = function(arg0) { + const ret = getObject(arg0).now(); + return ret; + }; + imports.wbg.__wbg_writeText_9c0cc5145d005509 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).writeText(getStringFromWasm0(arg1, arg2)); + return addHeapObject(ret); + }; + imports.wbg.__wbg_items_0076326dc6f1b7eb = function(arg0) { + const ret = getObject(arg0).items; + return addHeapObject(ret); + }; + imports.wbg.__wbg_files_e5c28ff6ab126f7b = function(arg0) { + const ret = getObject(arg0).files; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_getData_8aeca5994420c599 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = getObject(arg1).getData(getStringFromWasm0(arg2, arg3)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }, arguments) }; + imports.wbg.__wbg_dataTransfer_bac494821ce31837 = function(arg0) { + const ret = getObject(arg0).dataTransfer; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_instanceof_HtmlCanvasElement_da5f9efa0688cf6d = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLCanvasElement; + } catch { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_width_2931aaedd21f1fff = function(arg0) { + const ret = getObject(arg0).width; + return ret; + }; + imports.wbg.__wbg_setwidth_a667a942dba6656e = function(arg0, arg1) { + getObject(arg0).width = arg1 >>> 0; + }; + imports.wbg.__wbg_height_0d36fbbeb60b0661 = function(arg0) { + const ret = getObject(arg0).height; + return ret; + }; + imports.wbg.__wbg_setheight_a747d440760fe5aa = function(arg0, arg1) { + getObject(arg0).height = arg1 >>> 0; + }; + imports.wbg.__wbg_getContext_7c5944ea807bf5d3 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_matches_07c564b5b4101cf2 = function(arg0) { + const ret = getObject(arg0).matches; + return ret; + }; + imports.wbg.__wbg_matches_0f7e350783b542c2 = function(arg0) { + const ret = getObject(arg0).matches; + return ret; + }; + imports.wbg.__wbg_headers_b439dcff02e808e5 = function(arg0) { + const ret = getObject(arg0).headers; + return addHeapObject(ret); + }; + imports.wbg.__wbg_newwithstrandinit_cad5cd6038c7ff5d = function() { return handleError(function (arg0, arg1, arg2) { + const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_body_674aec4c1c0910cd = function(arg0) { + const ret = getObject(arg0).body; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_createElement_4891554b28d3388b = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_getElementById_cc0e0d931b0d9a28 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_setid_1984ee27e5075311 = function(arg0, arg1, arg2) { + getObject(arg0).id = getStringFromWasm0(arg1, arg2); + }; + imports.wbg.__wbg_scrollLeft_ea915614eac6bbeb = function(arg0) { + const ret = getObject(arg0).scrollLeft; + return ret; + }; + imports.wbg.__wbg_clientWidth_51ec21e3189f5656 = function(arg0) { + const ret = getObject(arg0).clientWidth; + return ret; + }; + imports.wbg.__wbg_clientHeight_09ec0b524d59c367 = function(arg0) { + const ret = getObject(arg0).clientHeight; + return ret; + }; + imports.wbg.__wbg_getBoundingClientRect_ac9db8cf97ca8083 = function(arg0) { + const ret = getObject(arg0).getBoundingClientRect(); + return addHeapObject(ret); + }; + imports.wbg.__wbg_instanceof_WebGlRenderingContext_ea632546035eecb1 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof WebGLRenderingContext; + } catch { + result = false; + } + const ret = result; + return ret; + }; + imports.wbg.__wbg_bufferData_a11a9f65f31e7256 = function(arg0, arg1, arg2, arg3) { + getObject(arg0).bufferData(arg1 >>> 0, getObject(arg2), arg3 >>> 0); + }; + imports.wbg.__wbg_texImage2D_6175916e58c59bc7 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + getObject(arg0).texImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, getObject(arg9)); + }, arguments) }; + imports.wbg.__wbg_texSubImage2D_f1a31f8045b7f831 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { + getObject(arg0).texSubImage2D(arg1 >>> 0, arg2, arg3, arg4, arg5, arg6, arg7 >>> 0, arg8 >>> 0, getObject(arg9)); + }, arguments) }; + imports.wbg.__wbg_activeTexture_93b4de60af07da9c = function(arg0, arg1) { + getObject(arg0).activeTexture(arg1 >>> 0); + }; + imports.wbg.__wbg_attachShader_b65b695055670cb5 = function(arg0, arg1, arg2) { + getObject(arg0).attachShader(getObject(arg1), getObject(arg2)); + }; + imports.wbg.__wbg_bindBuffer_313561e5bc0e533f = function(arg0, arg1, arg2) { + getObject(arg0).bindBuffer(arg1 >>> 0, getObject(arg2)); + }; + imports.wbg.__wbg_bindTexture_9cb5c770d1ba2cca = function(arg0, arg1, arg2) { + getObject(arg0).bindTexture(arg1 >>> 0, getObject(arg2)); + }; + imports.wbg.__wbg_blendEquationSeparate_7ec5e34f066e44f8 = function(arg0, arg1, arg2) { + getObject(arg0).blendEquationSeparate(arg1 >>> 0, arg2 >>> 0); + }; + imports.wbg.__wbg_blendFuncSeparate_7547ade0a7dfade2 = function(arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).blendFuncSeparate(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0, arg4 >>> 0); + }; + imports.wbg.__wbg_clear_2ccea1f65b510c97 = function(arg0, arg1) { + getObject(arg0).clear(arg1 >>> 0); + }; + imports.wbg.__wbg_clearColor_de587608b28bc7ed = function(arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).clearColor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_colorMask_7cbd7a102954ede9 = function(arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).colorMask(arg1 !== 0, arg2 !== 0, arg3 !== 0, arg4 !== 0); + }; + imports.wbg.__wbg_compileShader_d88d0a8cd9b72b4d = function(arg0, arg1) { + getObject(arg0).compileShader(getObject(arg1)); + }; + imports.wbg.__wbg_createBuffer_59051f4461e7c5e2 = function(arg0) { + const ret = getObject(arg0).createBuffer(); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_createProgram_88dbe21c0b682e1a = function(arg0) { + const ret = getObject(arg0).createProgram(); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_createShader_9d7d388633caad18 = function(arg0, arg1) { + const ret = getObject(arg0).createShader(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_createTexture_9d0bb4d741b8ad76 = function(arg0) { + const ret = getObject(arg0).createTexture(); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_deleteBuffer_cdc6b9c73f54aff7 = function(arg0, arg1) { + getObject(arg0).deleteBuffer(getObject(arg1)); + }; + imports.wbg.__wbg_deleteProgram_d8d7fc79ba83b256 = function(arg0, arg1) { + getObject(arg0).deleteProgram(getObject(arg1)); + }; + imports.wbg.__wbg_deleteShader_9a2f85efe5cb3706 = function(arg0, arg1) { + getObject(arg0).deleteShader(getObject(arg1)); + }; + imports.wbg.__wbg_deleteTexture_a883356c5034d482 = function(arg0, arg1) { + getObject(arg0).deleteTexture(getObject(arg1)); + }; + imports.wbg.__wbg_detachShader_a047ade0450ff0bf = function(arg0, arg1, arg2) { + getObject(arg0).detachShader(getObject(arg1), getObject(arg2)); + }; + imports.wbg.__wbg_disable_5cf2070641fa2ed7 = function(arg0, arg1) { + getObject(arg0).disable(arg1 >>> 0); + }; + imports.wbg.__wbg_disableVertexAttribArray_8dacd44e21adcaa2 = function(arg0, arg1) { + getObject(arg0).disableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_drawArrays_d5c7dc2b2376c85a = function(arg0, arg1, arg2, arg3) { + getObject(arg0).drawArrays(arg1 >>> 0, arg2, arg3); + }; + imports.wbg.__wbg_drawElements_3316ee0cd1117c2a = function(arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).drawElements(arg1 >>> 0, arg2, arg3 >>> 0, arg4); + }; + imports.wbg.__wbg_enable_8965e69c596f0a94 = function(arg0, arg1) { + getObject(arg0).enable(arg1 >>> 0); + }; + imports.wbg.__wbg_enableVertexAttribArray_2b0475db43533cf2 = function(arg0, arg1) { + getObject(arg0).enableVertexAttribArray(arg1 >>> 0); + }; + imports.wbg.__wbg_getAttribLocation_a5a98d5272b01c0d = function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).getAttribLocation(getObject(arg1), getStringFromWasm0(arg2, arg3)); + return ret; + }; + imports.wbg.__wbg_getError_1e5ec1ec9e58b323 = function(arg0) { + const ret = getObject(arg0).getError(); + return ret; + }; + imports.wbg.__wbg_getExtension_088d115a16ecbd7d = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).getExtension(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_getParameter_bfab7f0b00c9d7fb = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).getParameter(arg1 >>> 0); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_getProgramInfoLog_0b7af4ad85fa52a4 = function(arg0, arg1, arg2) { + const ret = getObject(arg1).getProgramInfoLog(getObject(arg2)); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_getProgramParameter_2a3735278367f8bc = function(arg0, arg1, arg2) { + const ret = getObject(arg0).getProgramParameter(getObject(arg1), arg2 >>> 0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_getShaderInfoLog_979aafa403ffb252 = function(arg0, arg1, arg2) { + const ret = getObject(arg1).getShaderInfoLog(getObject(arg2)); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_getShaderParameter_e8054f1d9026fb70 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).getShaderParameter(getObject(arg1), arg2 >>> 0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_getSupportedExtensions_4eb3a5f14f552ce5 = function(arg0) { + const ret = getObject(arg0).getSupportedExtensions(); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_getUniformLocation_688976233799a45a = function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).getUniformLocation(getObject(arg1), getStringFromWasm0(arg2, arg3)); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_linkProgram_9a2d12d120d99917 = function(arg0, arg1) { + getObject(arg0).linkProgram(getObject(arg1)); + }; + imports.wbg.__wbg_pixelStorei_5ec932ebefd00149 = function(arg0, arg1, arg2) { + getObject(arg0).pixelStorei(arg1 >>> 0, arg2); + }; + imports.wbg.__wbg_scissor_c8ec3b1e053f3756 = function(arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).scissor(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_shaderSource_f435f9b74440bb54 = function(arg0, arg1, arg2, arg3) { + getObject(arg0).shaderSource(getObject(arg1), getStringFromWasm0(arg2, arg3)); + }; + imports.wbg.__wbg_texParameteri_1f17358e51eb8069 = function(arg0, arg1, arg2, arg3) { + getObject(arg0).texParameteri(arg1 >>> 0, arg2 >>> 0, arg3); + }; + imports.wbg.__wbg_uniform1f_7586c5e17ad254c9 = function(arg0, arg1, arg2) { + getObject(arg0).uniform1f(getObject(arg1), arg2); + }; + imports.wbg.__wbg_uniform1i_9f94ef0ba6b3cc66 = function(arg0, arg1, arg2) { + getObject(arg0).uniform1i(getObject(arg1), arg2); + }; + imports.wbg.__wbg_uniform2f_69ee217590f07278 = function(arg0, arg1, arg2, arg3) { + getObject(arg0).uniform2f(getObject(arg1), arg2, arg3); + }; + imports.wbg.__wbg_useProgram_019eb6df066fabf5 = function(arg0, arg1) { + getObject(arg0).useProgram(getObject(arg1)); + }; + imports.wbg.__wbg_vertexAttribPointer_ca11984ee8843c0a = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + getObject(arg0).vertexAttribPointer(arg1 >>> 0, arg2, arg3 >>> 0, arg4 !== 0, arg5, arg6); + }; + imports.wbg.__wbg_viewport_6ebef187c89e2616 = function(arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).viewport(arg1, arg2, arg3, arg4); + }; + imports.wbg.__wbg_scrollTop_9e5ce77431551404 = function(arg0) { + const ret = getObject(arg0).scrollTop; + return ret; + }; + imports.wbg.__wbg_hidden_736e60e4fd2d186b = function(arg0) { + const ret = getObject(arg0).hidden; + return ret; + }; + imports.wbg.__wbg_sethidden_0cbfa2481b57c377 = function(arg0, arg1) { + getObject(arg0).hidden = arg1 !== 0; + }; + imports.wbg.__wbg_style_3801009b2339aa94 = function(arg0) { + const ret = getObject(arg0).style; + return addHeapObject(ret); + }; + imports.wbg.__wbg_offsetTop_815aa9ab53b3cf18 = function(arg0) { + const ret = getObject(arg0).offsetTop; + return ret; + }; + imports.wbg.__wbg_offsetLeft_3b7ae7e9baa5358a = function(arg0) { + const ret = getObject(arg0).offsetLeft; + return ret; + }; + imports.wbg.__wbg_offsetWidth_4e9930121c69297f = function(arg0) { + const ret = getObject(arg0).offsetWidth; + return ret; + }; + imports.wbg.__wbg_blur_53431c003c82bf53 = function() { return handleError(function (arg0) { + getObject(arg0).blur(); + }, arguments) }; + imports.wbg.__wbg_focus_dbcbbbb2a04c0e1f = function() { return handleError(function (arg0) { + getObject(arg0).focus(); + }, arguments) }; + imports.wbg.__wbg_length_dd2eb44022569c32 = function(arg0) { + const ret = getObject(arg0).length; + return ret; + }; + imports.wbg.__wbg_get_135f0a95f49ed3ff = function(arg0, arg1) { + const ret = getObject(arg0)[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_name_a46b2d975591a0b3 = function(arg0, arg1) { + const ret = getObject(arg1).name; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_lastModified_711034410dfc02ad = function(arg0) { + const ret = getObject(arg0).lastModified; + return ret; + }; + imports.wbg.__wbg_keyCode_dfa86be31f5ef90c = function(arg0) { + const ret = getObject(arg0).keyCode; + return ret; + }; + imports.wbg.__wbg_altKey_612289acf855835c = function(arg0) { + const ret = getObject(arg0).altKey; + return ret; + }; + imports.wbg.__wbg_ctrlKey_582686fb2263dd3c = function(arg0) { + const ret = getObject(arg0).ctrlKey; + return ret; + }; + imports.wbg.__wbg_shiftKey_48e8701355d8e2d4 = function(arg0) { + const ret = getObject(arg0).shiftKey; + return ret; + }; + imports.wbg.__wbg_metaKey_43193b7cc99f8914 = function(arg0) { + const ret = getObject(arg0).metaKey; + return ret; + }; + imports.wbg.__wbg_isComposing_f41d219def91d438 = function(arg0) { + const ret = getObject(arg0).isComposing; + return ret; + }; + imports.wbg.__wbg_key_8aeaa079126a9cc7 = function(arg0, arg1) { + const ret = getObject(arg1).key; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_clipboard_47d5c6d7496034ae = function(arg0) { + const ret = getObject(arg0).clipboard; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_userAgent_2053026e2b1e0c7e = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).userAgent; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }, arguments) }; + imports.wbg.__wbg_speaking_f518bada6d9d9beb = function(arg0) { + const ret = getObject(arg0).speaking; + return ret; + }; + imports.wbg.__wbg_cancel_5e5d3ec8238c4c1b = function(arg0) { + getObject(arg0).cancel(); + }; + imports.wbg.__wbg_getVoices_c24bab8ed59e417e = function(arg0) { + const ret = getObject(arg0).getVoices(); + return addHeapObject(ret); + }; + imports.wbg.__wbg_speak_c5dda9a5a88d036d = function(arg0, arg1) { + getObject(arg0).speak(getObject(arg1)); + }; + imports.wbg.__wbg_identifier_da93d3d09ccdc54c = function(arg0) { + const ret = getObject(arg0).identifier; + return ret; + }; + imports.wbg.__wbg_pageX_8e76f76ea9375a85 = function(arg0) { + const ret = getObject(arg0).pageX; + return ret; + }; + imports.wbg.__wbg_pageY_a5a407b52fe202e7 = function(arg0) { + const ret = getObject(arg0).pageY; + return ret; + }; + imports.wbg.__wbg_force_4dd0ab6e9ef993ec = function(arg0) { + const ret = getObject(arg0).force; + return ret; + }; + imports.wbg.__wbg_clipboardData_c480a3b34e3e7b1d = function(arg0) { + const ret = getObject(arg0).clipboardData; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_preventDefault_24104f3f0a54546a = function(arg0) { + getObject(arg0).preventDefault(); + }; + imports.wbg.__wbg_stopPropagation_55539cfa2506c867 = function(arg0) { + getObject(arg0).stopPropagation(); + }; + imports.wbg.__wbg_parentElement_c75962bc9997ea5f = function(arg0) { + const ret = getObject(arg0).parentElement; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__wbg_appendChild_51339d4cde00ee22 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).appendChild(getObject(arg1)); + return addHeapObject(ret); + }, arguments) }; + imports.wbg.__wbg_touches_8338f31b10bd7975 = function(arg0) { + const ret = getObject(arg0).touches; + return addHeapObject(ret); + }; + imports.wbg.__wbg_changedTouches_60ab7fa55837664f = function(arg0) { + const ret = getObject(arg0).changedTouches; + return addHeapObject(ret); + }; + imports.wbg.__wbg_size_b9bc39a333bd5d88 = function(arg0) { + const ret = getObject(arg0).size; + return ret; + }; + imports.wbg.__wbg_arrayBuffer_27cefaea55cbf063 = function(arg0) { + const ret = getObject(arg0).arrayBuffer(); + return addHeapObject(ret); + }; + imports.wbg.__wbg_setProperty_b95ef63ab852879e = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).setProperty(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_top_98ff0408c018d25e = function(arg0) { + const ret = getObject(arg0).top; + return ret; + }; + imports.wbg.__wbg_left_23a613d619fb4206 = function(arg0) { + const ret = getObject(arg0).left; + return ret; + }; + imports.wbg.__wbg_href_d62a28e4fc1ab948 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).href; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }, arguments) }; + imports.wbg.__wbg_origin_50aa482fa6784a0a = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).origin; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }, arguments) }; + imports.wbg.__wbg_protocol_91948f5885595359 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).protocol; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }, arguments) }; + imports.wbg.__wbg_host_15090f3de0544fea = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).host; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }, arguments) }; + imports.wbg.__wbg_hostname_b77e5e70d6ff6236 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).hostname; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }, arguments) }; + imports.wbg.__wbg_port_1b2b1249cacfca76 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).port; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }, arguments) }; + imports.wbg.__wbg_search_6c3c472e076ee010 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).search; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }, arguments) }; + imports.wbg.__wbg_hash_a1a795b89dda8e3d = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).hash; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }, arguments) }; + imports.wbg.__wbg_getItem_ed8e218e51f1efeb = function() { return handleError(function (arg0, arg1, arg2, arg3) { + const ret = getObject(arg1).getItem(getStringFromWasm0(arg2, arg3)); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }, arguments) }; + imports.wbg.__wbg_setItem_d002ee486462bfff = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).setItem(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments) }; + imports.wbg.__wbg_get_44be0491f933a435 = function(arg0, arg1) { const ret = getObject(arg0)[arg1 >>> 0]; return addHeapObject(ret); }; - imports.wbg.__wbg_length_820c786973abdd8a = function(arg0) { + imports.wbg.__wbg_length_fff51ee6522a1a18 = function(arg0) { const ret = getObject(arg0).length; return ret; }; @@ -1489,7 +1489,7 @@ function __wbg_get_imports() { const ret = typeof(getObject(arg0)) === 'function'; return ret; }; - imports.wbg.__wbg_newnoargs_c9e6043b8ad84109 = function(arg0, arg1) { + imports.wbg.__wbg_newnoargs_581967eacc0e2604 = function(arg0, arg1) { const ret = new Function(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); }; @@ -1498,51 +1498,51 @@ function __wbg_get_imports() { const ret = typeof(val) === 'object' && val !== null; return ret; }; - imports.wbg.__wbg_next_f4bc0e96ea67da68 = function(arg0) { + imports.wbg.__wbg_next_526fc47e980da008 = function(arg0) { const ret = getObject(arg0).next; return addHeapObject(ret); }; - imports.wbg.__wbg_next_ec061e48a0e72a96 = function() { return handleError(function (arg0) { + imports.wbg.__wbg_next_ddb3312ca1c4e32a = function() { return handleError(function (arg0) { const ret = getObject(arg0).next(); return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_done_b6abb27d42b63867 = function(arg0) { + imports.wbg.__wbg_done_5c1f01fb660d73b5 = function(arg0) { const ret = getObject(arg0).done; return ret; }; - imports.wbg.__wbg_value_2f4ef2036bfad28e = function(arg0) { + imports.wbg.__wbg_value_1695675138684bd5 = function(arg0) { const ret = getObject(arg0).value; return addHeapObject(ret); }; - imports.wbg.__wbg_iterator_7c7e58f62eb84700 = function() { + imports.wbg.__wbg_iterator_97f0c81209c6c35a = function() { const ret = Symbol.iterator; return addHeapObject(ret); }; - imports.wbg.__wbg_get_f53c921291c381bd = function() { return handleError(function (arg0, arg1) { + imports.wbg.__wbg_get_97b561fb56f034b5 = function() { return handleError(function (arg0, arg1) { const ret = Reflect.get(getObject(arg0), getObject(arg1)); return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_call_557a2f2deacc4912 = function() { return handleError(function (arg0, arg1) { + imports.wbg.__wbg_call_cb65541d95d71282 = function() { return handleError(function (arg0, arg1) { const ret = getObject(arg0).call(getObject(arg1)); return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_new_2b6fea4ea03b1b95 = function() { + imports.wbg.__wbg_new_b51585de1b234aff = function() { const ret = new Object(); return addHeapObject(ret); }; - imports.wbg.__wbg_self_742dd6eab3e9211e = function() { return handleError(function () { + imports.wbg.__wbg_self_1ff1d729e9aae938 = function() { return handleError(function () { const ret = self.self; return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_window_c409e731db53a0e2 = function() { return handleError(function () { + imports.wbg.__wbg_window_5f4faef6c12b79ec = function() { return handleError(function () { const ret = window.window; return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_globalThis_b70c095388441f2d = function() { return handleError(function () { + imports.wbg.__wbg_globalThis_1d39714405582d3c = function() { return handleError(function () { const ret = globalThis.globalThis; return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_global_1c72617491ed7194 = function() { return handleError(function () { + imports.wbg.__wbg_global_651f05c6a0944d1c = function() { return handleError(function () { const ret = global.global; return addHeapObject(ret); }, arguments) }; @@ -1550,23 +1550,23 @@ function __wbg_get_imports() { const ret = getObject(arg0) === undefined; return ret; }; - imports.wbg.__wbg_call_587b30eea3e09332 = function() { return handleError(function (arg0, arg1, arg2) { + imports.wbg.__wbg_call_01734de55d61e11d = function() { return handleError(function (arg0, arg1, arg2) { const ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_getTime_40bd09e020e8bc8c = function(arg0) { + imports.wbg.__wbg_getTime_5e2054f832d82ec9 = function(arg0) { const ret = getObject(arg0).getTime(); return ret; }; - imports.wbg.__wbg_getTimezoneOffset_884011df4eb8cabc = function(arg0) { + imports.wbg.__wbg_getTimezoneOffset_8aee3445f323973e = function(arg0) { const ret = getObject(arg0).getTimezoneOffset(); return ret; }; - imports.wbg.__wbg_new0_494c19a27871d56f = function() { + imports.wbg.__wbg_new0_c0be7df4b6bd481f = function() { const ret = new Date(); return addHeapObject(ret); }; - imports.wbg.__wbg_new_2b55e405e4af4986 = function(arg0, arg1) { + imports.wbg.__wbg_new_43f1b47c28813cbd = function(arg0, arg1) { try { var state0 = {a: arg0, b: arg1}; var cb0 = (arg0, arg1) => { @@ -1584,62 +1584,62 @@ function __wbg_get_imports() { state0.a = state0.b = 0; } }; - imports.wbg.__wbg_resolve_ae38ad63c43ff98b = function(arg0) { + imports.wbg.__wbg_resolve_53698b95aaf7fcf8 = function(arg0) { const ret = Promise.resolve(getObject(arg0)); return addHeapObject(ret); }; - imports.wbg.__wbg_then_8df675b8bb5d5e3c = function(arg0, arg1) { + imports.wbg.__wbg_then_f7e06ee3c11698eb = function(arg0, arg1) { const ret = getObject(arg0).then(getObject(arg1)); return addHeapObject(ret); }; - imports.wbg.__wbg_then_835b073a479138e5 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_then_b2267541e2a73865 = function(arg0, arg1, arg2) { const ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); return addHeapObject(ret); }; - imports.wbg.__wbg_buffer_55ba7a6b1b92e2ac = function(arg0) { + imports.wbg.__wbg_buffer_085ec1f694018c4f = function(arg0) { const ret = getObject(arg0).buffer; return addHeapObject(ret); }; - imports.wbg.__wbg_newwithbyteoffsetandlength_abbb764f85f16b6b = function(arg0, arg1, arg2) { + imports.wbg.__wbg_newwithbyteoffsetandlength_828b952f0e692245 = function(arg0, arg1, arg2) { const ret = new Int8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbg_newwithbyteoffsetandlength_6889cd5c48bfda26 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_newwithbyteoffsetandlength_735ed5ea2ae07fe9 = function(arg0, arg1, arg2) { const ret = new Int16Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbg_newwithbyteoffsetandlength_23602c96f86e952a = function(arg0, arg1, arg2) { + imports.wbg.__wbg_newwithbyteoffsetandlength_9f43b22ab631d1d6 = function(arg0, arg1, arg2) { const ret = new Int32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbg_newwithbyteoffsetandlength_88d1d8be5df94b9b = function(arg0, arg1, arg2) { + imports.wbg.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function(arg0, arg1, arg2) { const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbg_new_09938a7d020f049b = function(arg0) { + imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) { const ret = new Uint8Array(getObject(arg0)); return addHeapObject(ret); }; - imports.wbg.__wbg_set_3698e3ca519b3c3c = function(arg0, arg1, arg2) { + imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) { getObject(arg0).set(getObject(arg1), arg2 >>> 0); }; - imports.wbg.__wbg_length_0aab7ffd65ad19ed = function(arg0) { + imports.wbg.__wbg_length_72e2208bbc0efc61 = function(arg0) { const ret = getObject(arg0).length; return ret; }; - imports.wbg.__wbg_newwithbyteoffsetandlength_051cff28f608b6cb = function(arg0, arg1, arg2) { + imports.wbg.__wbg_newwithbyteoffsetandlength_31ff1024ef0c63c7 = function(arg0, arg1, arg2) { const ret = new Uint16Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbg_newwithbyteoffsetandlength_fae0a69639559788 = function(arg0, arg1, arg2) { + imports.wbg.__wbg_newwithbyteoffsetandlength_6df0e8c3efd2a5d3 = function(arg0, arg1, arg2) { const ret = new Uint32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbg_newwithbyteoffsetandlength_ab5b524f83702d8d = function(arg0, arg1, arg2) { + imports.wbg.__wbg_newwithbyteoffsetandlength_69193e31c844b792 = function(arg0, arg1, arg2) { const ret = new Float32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); return addHeapObject(ret); }; - imports.wbg.__wbg_set_07da13cc24b69217 = function() { return handleError(function (arg0, arg1, arg2) { + imports.wbg.__wbg_set_092e06b0f9d71865 = function() { return handleError(function (arg0, arg1, arg2) { const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2)); return ret; }, arguments) }; @@ -1657,28 +1657,28 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9594 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1373, __wbg_adapter_28); + imports.wbg.__wbindgen_closure_wrapper10784 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1464, __wbg_adapter_28); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9596 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1371, __wbg_adapter_31); + imports.wbg.__wbindgen_closure_wrapper10786 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1462, __wbg_adapter_31); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper9598 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1375, __wbg_adapter_34); + imports.wbg.__wbindgen_closure_wrapper10788 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1466, __wbg_adapter_34); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10970 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 1545, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper12539 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 1524, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper10972 = function(arg0, arg1, arg2) { - const ret = makeClosure(arg0, arg1, 1545, __wbg_adapter_37); + imports.wbg.__wbindgen_closure_wrapper12541 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 1524, __wbg_adapter_37); return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper11010 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 1568, __wbg_adapter_42); + imports.wbg.__wbindgen_closure_wrapper12581 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 1547, __wbg_adapter_42); return addHeapObject(ret); }; diff --git a/docs/egui_demo_app_bg.wasm b/docs/egui_demo_app_bg.wasm index 811c76848..14e095cb6 100644 Binary files a/docs/egui_demo_app_bg.wasm and b/docs/egui_demo_app_bg.wasm differ diff --git a/examples/retained_image/src/crab.png b/examples/retained_image/src/crab.png new file mode 100644 index 000000000..781b21993 Binary files /dev/null and b/examples/retained_image/src/crab.png differ diff --git a/examples/retained_image/src/main.rs b/examples/retained_image/src/main.rs index 171f16a5d..3b4634384 100644 --- a/examples/retained_image/src/main.rs +++ b/examples/retained_image/src/main.rs @@ -6,7 +6,7 @@ use egui_extras::RetainedImage; fn main() -> Result<(), eframe::Error> { env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`). let options = eframe::NativeOptions { - initial_window_size: Some(egui::vec2(300.0, 900.0)), + initial_window_size: Some(egui::vec2(400.0, 1000.0)), ..Default::default() }; eframe::run_native( @@ -18,18 +18,17 @@ fn main() -> Result<(), eframe::Error> { struct MyApp { image: RetainedImage, + rounding: f32, tint: egui::Color32, } impl Default for MyApp { fn default() -> Self { Self { - image: RetainedImage::from_image_bytes( - "rust-logo-256x256.png", - include_bytes!("rust-logo-256x256.png"), - ) - .unwrap(), - tint: egui::Color32::from_rgb(255, 0, 255), + // crab image is CC0, found on https://stocksnap.io/search/crab + image: RetainedImage::from_image_bytes("crab.png", include_bytes!("crab.png")).unwrap(), + rounding: 32.0, + tint: egui::Color32::from_rgb(100, 200, 200), } } } @@ -45,30 +44,50 @@ impl eframe::App for MyApp { render(ctx); return; } + + let Self { + image, + rounding, + tint, + } = self; + egui::CentralPanel::default().show(ctx, |ui| { ui.heading("This is an image:"); - self.image.show(ui); + image.show(ui); - ui.heading("This is a rotated image with a tint:"); + ui.add_space(32.0); + + ui.heading("This is a tinted image with rounded corners:"); ui.add( - egui::Image::new(self.image.texture_id(ctx), self.image.size_vec2()) - .rotate(45.0_f32.to_radians(), egui::Vec2::splat(0.5)) - .tint(self.tint), + egui::Image::new(image.texture_id(ctx), image.size_vec2()) + .tint(*tint) + .rounding(*rounding), ); ui.horizontal(|ui| { ui.label("Tint:"); egui::color_picker::color_edit_button_srgba( ui, - &mut self.tint, + tint, egui::color_picker::Alpha::BlendOrAdditive, ); + + ui.add_space(16.0); + + ui.label("Rounding:"); + ui.add( + egui::DragValue::new(rounding) + .speed(1.0) + .clamp_range(0.0..=0.5 * image.size_vec2().min_elem()), + ); }); + ui.add_space(32.0); + ui.heading("This is an image you can click:"); ui.add(egui::ImageButton::new( - self.image.texture_id(ctx), - self.image.size_vec2(), + image.texture_id(ctx), + image.size_vec2(), )); }); } diff --git a/examples/retained_image/src/rust-logo-256x256.png b/examples/retained_image/src/rust-logo-256x256.png deleted file mode 100644 index f5ddd63fe..000000000 Binary files a/examples/retained_image/src/rust-logo-256x256.png and /dev/null differ diff --git a/examples/retained_image/src/rust-logo-license.txt b/examples/retained_image/src/rust-logo-license.txt deleted file mode 100644 index 7efaf7593..000000000 --- a/examples/retained_image/src/rust-logo-license.txt +++ /dev/null @@ -1 +0,0 @@ -Rust logo by Mozilla, from https://github.com/rust-lang/rust-artwork