diff options
Diffstat (limited to 'alacritty/src/renderer')
-rw-r--r-- | alacritty/src/renderer/mod.rs | 6 | ||||
-rw-r--r-- | alacritty/src/renderer/shader.rs | 12 | ||||
-rw-r--r-- | alacritty/src/renderer/text/builtin_font.rs | 16 |
3 files changed, 17 insertions, 17 deletions
diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs index 87ccf2f6..bd3c0015 100644 --- a/alacritty/src/renderer/mod.rs +++ b/alacritty/src/renderer/mod.rs @@ -92,7 +92,7 @@ impl Renderer { /// supported OpenGL version. pub fn new( context: &PossiblyCurrentContext, - renderer_prefernce: Option<RendererPreference>, + renderer_preference: Option<RendererPreference>, ) -> Result<Self, Error> { // We need to load OpenGL functions once per instance, but only after we make our context // current due to WGL limitations. @@ -119,7 +119,7 @@ impl Renderer { let is_gles_context = matches!(context.context_api(), ContextApi::Gles(_)); // Use the config option to enforce a particular renderer configuration. - let (use_glsl3, allow_dsb) = match renderer_prefernce { + let (use_glsl3, allow_dsb) = match renderer_preference { Some(RendererPreference::Glsl3) => (true, true), Some(RendererPreference::Gles2) => (false, true), Some(RendererPreference::Gles2Pure) => (false, false), @@ -288,7 +288,7 @@ struct GlExtensions; impl GlExtensions { /// Check if the given `extension` is supported. /// - /// This function will lazyly load OpenGL extensions. + /// This function will lazily load OpenGL extensions. fn contains(extension: &str) -> bool { static OPENGL_EXTENSIONS: OnceCell<HashSet<&'static str, RandomState>> = OnceCell::new(); diff --git a/alacritty/src/renderer/shader.rs b/alacritty/src/renderer/shader.rs index 588937cc..e3baab9e 100644 --- a/alacritty/src/renderer/shader.rs +++ b/alacritty/src/renderer/shader.rs @@ -91,17 +91,17 @@ impl Shader { ) -> Result<Self, ShaderError> { let version_header = shader_version.shader_header(); let mut sources = Vec::<*const GLchar>::with_capacity(3); - let mut lengthes = Vec::<GLint>::with_capacity(3); + let mut lengths = Vec::<GLint>::with_capacity(3); sources.push(version_header.as_ptr().cast()); - lengthes.push(version_header.len() as GLint); + lengths.push(version_header.len() as GLint); if let Some(shader_header) = shader_header { sources.push(shader_header.as_ptr().cast()); - lengthes.push(shader_header.len() as GLint); + lengths.push(shader_header.len() as GLint); } sources.push(source.as_ptr().cast()); - lengthes.push(source.len() as GLint); + lengths.push(source.len() as GLint); let shader = unsafe { Self(gl::CreateShader(kind)) }; @@ -109,9 +109,9 @@ impl Shader { unsafe { gl::ShaderSource( shader.id(), - lengthes.len() as GLint, + lengths.len() as GLint, sources.as_ptr().cast(), - lengthes.as_ptr(), + lengths.as_ptr(), ); gl::CompileShader(shader.id()); gl::GetShaderiv(shader.id(), gl::COMPILE_STATUS, &mut success); diff --git a/alacritty/src/renderer/text/builtin_font.rs b/alacritty/src/renderer/text/builtin_font.rs index 06eb5bc0..3934b30f 100644 --- a/alacritty/src/renderer/text/builtin_font.rs +++ b/alacritty/src/renderer/text/builtin_font.rs @@ -40,7 +40,7 @@ fn box_drawing(character: char, metrics: &Metrics, offset: &Delta<i8>) -> Raster // Ensure that width and height is at least one. let height = (metrics.line_height as i32 + offset.y as i32).max(1) as usize; let width = (metrics.average_advance as i32 + offset.x as i32).max(1) as usize; - // Use one eight of the cell width, since this is used as a step size for block elemenets. + // Use one eight of the cell width, since this is used as a step size for block elements. let stroke_size = cmp::max((width as f32 / 8.).round() as usize, 1); let heavy_stroke_size = stroke_size * 2; @@ -704,10 +704,10 @@ impl Canvas { /// vertex and co-vertex respectively using a given `stroke` in the bottom-right quadrant of the /// `Canvas` coordinate system. fn draw_ellipse_arc(&mut self, stroke_size: usize) { - fn colors_with_error(error: f32, max_transparancy: f32) -> (Pixel, Pixel) { - let transparancy = error * max_transparancy; - let alpha_1 = 1. - transparancy; - let alpha_2 = 1. - (max_transparancy - transparancy); + fn colors_with_error(error: f32, max_transparency: f32) -> (Pixel, Pixel) { + let transparency = error * max_transparency; + let alpha_1 = 1. - transparency; + let alpha_2 = 1. - (max_transparency - transparency); let color_1 = Pixel::gray((COLOR_FILL._r as f32 * alpha_1) as u8); let color_2 = Pixel::gray((COLOR_FILL._r as f32 * alpha_2) as u8); (color_1, color_2) @@ -717,7 +717,7 @@ impl Canvas { let v_line_bounds = self.v_line_bounds(self.x_center(), stroke_size); let h_line_bounds = (h_line_bounds.0 as usize, h_line_bounds.1 as usize); let v_line_bounds = (v_line_bounds.0 as usize, v_line_bounds.1 as usize); - let max_transparancy = 0.5; + let max_transparency = 0.5; for (radius_y, radius_x) in (h_line_bounds.0..h_line_bounds.1).zip(v_line_bounds.0..v_line_bounds.1) @@ -733,7 +733,7 @@ impl Canvas { let y = radius_y * f32::sqrt(1. - x * x / radius_x2); let error = y.fract(); - let (color_1, color_2) = colors_with_error(error, max_transparancy); + let (color_1, color_2) = colors_with_error(error, max_transparency); let x = x.clamp(0., radius_x); let y_next = (y + 1.).clamp(0., h_line_bounds.1 as f32 - 1.); @@ -749,7 +749,7 @@ impl Canvas { let x = radius_x * f32::sqrt(1. - y * y / radius_y2); let error = x - x.fract(); - let (color_1, color_2) = colors_with_error(error, max_transparancy); + let (color_1, color_2) = colors_with_error(error, max_transparency); let x_next = (x + 1.).clamp(0., v_line_bounds.1 as f32 - 1.); let x = x.clamp(0., v_line_bounds.1 as f32 - 1.); |