From 500ba962d17853bdef7aed49b150dbe3f45692e9 Mon Sep 17 00:00:00 2001 From: rustrover Date: Sat, 9 Mar 2024 15:26:37 +0800 Subject: fix some comments Signed-off-by: rustrover --- core/src/background.rs | 2 +- core/src/widget/text.rs | 2 +- examples/integration/README.md | 2 +- examples/integration/src/main.rs | 2 +- graphics/src/error.rs | 4 ++-- wgpu/src/shader/quad.wgsl | 2 +- widget/src/image/viewer.rs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/src/background.rs b/core/src/background.rs index eb4b5021..c8b7cbea 100644 --- a/core/src/background.rs +++ b/core/src/background.rs @@ -12,7 +12,7 @@ pub enum Background { } impl Background { - /// Scales the the alpha channel of the [`Background`] by the given + /// Scales the alpha channel of the [`Background`] by the given /// factor. pub fn scale_alpha(self, factor: f32) -> Self { match self { diff --git a/core/src/widget/text.rs b/core/src/widget/text.rs index a220127c..0305972b 100644 --- a/core/src/widget/text.rs +++ b/core/src/widget/text.rs @@ -330,7 +330,7 @@ where } } -/// The apperance of some text. +/// The appearance of some text. #[derive(Debug, Clone, Copy, Default)] pub struct Appearance { /// The [`Color`] of the text. diff --git a/examples/integration/README.md b/examples/integration/README.md index 996cdc17..aa3a6e94 100644 --- a/examples/integration/README.md +++ b/examples/integration/README.md @@ -14,7 +14,7 @@ cargo run --package integration_wgpu ``` ### How to run this example with WebGL backend -NOTE: Currently, WebGL backend is is still experimental, so expect bugs. +NOTE: Currently, WebGL backend is still experimental, so expect bugs. ```sh # 0. Install prerequisites diff --git a/examples/integration/src/main.rs b/examples/integration/src/main.rs index f53b5bf1..9cd801b2 100644 --- a/examples/integration/src/main.rs +++ b/examples/integration/src/main.rs @@ -170,7 +170,7 @@ pub fn main() -> Result<(), Box> { // Run event loop event_loop.run(move |event, window_target| { - // You should change this if you want to render continuosly + // You should change this if you want to render continuously window_target.set_control_flow(ControlFlow::Wait); match event { diff --git a/graphics/src/error.rs b/graphics/src/error.rs index 77758f54..c6ea98a3 100644 --- a/graphics/src/error.rs +++ b/graphics/src/error.rs @@ -13,7 +13,7 @@ pub enum Error { #[error("a suitable graphics adapter or device could not be found")] GraphicsAdapterNotFound, - /// An error occured in the context's internal backend - #[error("an error occured in the context's internal backend")] + /// An error occurred in the context's internal backend + #[error("an error occurred in the context's internal backend")] BackendError(String), } diff --git a/wgpu/src/shader/quad.wgsl b/wgpu/src/shader/quad.wgsl index 4de73362..a367d5e6 100644 --- a/wgpu/src/shader/quad.wgsl +++ b/wgpu/src/shader/quad.wgsl @@ -22,7 +22,7 @@ fn rounded_box_sdf(to_center: vec2, size: vec2, radius: f32) -> f32 { return length(max(abs(to_center) - size + vec2(radius, radius), vec2(0.0, 0.0))) - radius; } -// Based on the fragement position and the center of the quad, select one of the 4 radi. +// Based on the fragment position and the center of the quad, select one of the 4 radi. // Order matches CSS border radius attribute: // radi.x = top-left, radi.y = top-right, radi.z = bottom-right, radi.w = bottom-left fn select_border_radius(radi: vec4, position: vec2, center: vec2) -> f32 { diff --git a/widget/src/image/viewer.rs b/widget/src/image/viewer.rs index 9666ff9f..f45c401a 100644 --- a/widget/src/image/viewer.rs +++ b/widget/src/image/viewer.rs @@ -126,7 +126,7 @@ where }; // Only calculate viewport sizes if the images are constrained to a limited space. - // If they are Fill|Portion let them expand within their alotted space. + // If they are Fill|Portion let them expand within their allotted space. match expansion_size { Length::Shrink | Length::Fixed(_) => { let aspect_ratio = width as f32 / height as f32; -- cgit