fix some comments
Signed-off-by: rustrover <seekseat@126.com>
This commit is contained in:
parent
a341e39df6
commit
500ba962d1
7 changed files with 8 additions and 8 deletions
|
|
@ -12,7 +12,7 @@ pub enum Background {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl 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.
|
/// factor.
|
||||||
pub fn scale_alpha(self, factor: f32) -> Self {
|
pub fn scale_alpha(self, factor: f32) -> Self {
|
||||||
match self {
|
match self {
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The apperance of some text.
|
/// The appearance of some text.
|
||||||
#[derive(Debug, Clone, Copy, Default)]
|
#[derive(Debug, Clone, Copy, Default)]
|
||||||
pub struct Appearance {
|
pub struct Appearance {
|
||||||
/// The [`Color`] of the text.
|
/// The [`Color`] of the text.
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ cargo run --package integration_wgpu
|
||||||
```
|
```
|
||||||
|
|
||||||
### How to run this example with WebGL backend
|
### 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
|
```sh
|
||||||
# 0. Install prerequisites
|
# 0. Install prerequisites
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|
||||||
// Run event loop
|
// Run event loop
|
||||||
event_loop.run(move |event, window_target| {
|
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);
|
window_target.set_control_flow(ControlFlow::Wait);
|
||||||
|
|
||||||
match event {
|
match event {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ pub enum Error {
|
||||||
#[error("a suitable graphics adapter or device could not be found")]
|
#[error("a suitable graphics adapter or device could not be found")]
|
||||||
GraphicsAdapterNotFound,
|
GraphicsAdapterNotFound,
|
||||||
|
|
||||||
/// An error occured in the context's internal backend
|
/// An error occurred in the context's internal backend
|
||||||
#[error("an error occured in the context's internal backend")]
|
#[error("an error occurred in the context's internal backend")]
|
||||||
BackendError(String),
|
BackendError(String),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ fn rounded_box_sdf(to_center: vec2<f32>, size: vec2<f32>, radius: f32) -> f32 {
|
||||||
return length(max(abs(to_center) - size + vec2<f32>(radius, radius), vec2<f32>(0.0, 0.0))) - radius;
|
return length(max(abs(to_center) - size + vec2<f32>(radius, radius), vec2<f32>(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:
|
// Order matches CSS border radius attribute:
|
||||||
// radi.x = top-left, radi.y = top-right, radi.z = bottom-right, radi.w = bottom-left
|
// radi.x = top-left, radi.y = top-right, radi.z = bottom-right, radi.w = bottom-left
|
||||||
fn select_border_radius(radi: vec4<f32>, position: vec2<f32>, center: vec2<f32>) -> f32 {
|
fn select_border_radius(radi: vec4<f32>, position: vec2<f32>, center: vec2<f32>) -> f32 {
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ where
|
||||||
};
|
};
|
||||||
|
|
||||||
// Only calculate viewport sizes if the images are constrained to a limited space.
|
// 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 {
|
match expansion_size {
|
||||||
Length::Shrink | Length::Fixed(_) => {
|
Length::Shrink | Length::Fixed(_) => {
|
||||||
let aspect_ratio = width as f32 / height as f32;
|
let aspect_ratio = width as f32 / height as f32;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue