diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-07-21 17:17:41 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-21 17:17:41 +0000 |
commit | f50ca1a54c94fe324d22d985c1acae1ff7c16a80 (patch) | |
tree | 7fc2e79f7dccf512fe71f841ef5434e0b1d2b5d7 /src/display.rs | |
parent | b05ad74fe6d42ce0f913e02ef633ca119fc0b43e (diff) | |
download | alacritty-f50ca1a54c94fe324d22d985c1acae1ff7c16a80.tar.gz alacritty-f50ca1a54c94fe324d22d985c1acae1ff7c16a80.zip |
Scrollback cleanup
There were some unneeded codeblocks and TODO/XXX comments in the code
that have been removed. All issues marked with TODO/XXX have either been
already resolved or tracking issues exist.
Diffstat (limited to 'src/display.rs')
-rw-r--r-- | src/display.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/display.rs b/src/display.rs index 5e540a8b..4c3ffed1 100644 --- a/src/display.rs +++ b/src/display.rs @@ -136,12 +136,16 @@ impl Display { let render_timer = config.render_timer(); // Create the window where Alacritty will be displayed - let mut window = Window::new(&options.title, config.window())?; + let mut window = Window::new(&options, config.window())?; // get window properties for initializing the other subsystems let mut viewport_size = window.inner_size_pixels() .expect("glutin returns window size"); - let dpr = window.hidpi_factor(); + let dpr = if config.font().scale_with_dpi() { + window.hidpi_factor() + } else { + 1.0 + }; info!("device_pixel_ratio: {}", dpr); @@ -149,7 +153,7 @@ impl Display { let mut renderer = QuadRenderer::new(config, viewport_size)?; let (glyph_cache, cell_width, cell_height) = - Self::new_glyph_cache(&window, &mut renderer, config)?; + Self::new_glyph_cache(dpr, &mut renderer, config)?; let dimensions = options.dimensions() @@ -210,11 +214,10 @@ impl Display { }) } - fn new_glyph_cache(window : &Window, renderer : &mut QuadRenderer, config: &Config) + fn new_glyph_cache(dpr: f32, renderer: &mut QuadRenderer, config: &Config) -> Result<(GlyphCache, f32, f32), Error> { let font = config.font().clone(); - let dpr = window.hidpi_factor(); let rasterizer = font::Rasterizer::new(dpr, config.use_thin_strokes())?; // Initialize glyph cache |