diff options
author | Christian Duerr <contact@christianduerr.com> | 2018-08-10 17:18:17 +0200 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2018-08-10 17:18:17 +0200 |
commit | 4dc3c3c5a57796b3198429d395e2dded227eb94b (patch) | |
tree | 99a97f7de370e207130818778418364abb22cc62 | |
parent | 3c0e26843802ceb6afef25d400bf282f66825eac (diff) | |
download | alacritty-4dc3c3c5a57796b3198429d395e2dded227eb94b.tar.gz alacritty-4dc3c3c5a57796b3198429d395e2dded227eb94b.zip |
Fix formatting and resize conversion comment
Some minor formating issues were still present in the current state of
the PR, these should all be resolved with this.
The comment about converting between logical and physical sizes was also
still present in the `src/display.rs` even though the conversion itself
has been moved to the `src/event.rs` file. To fix this the comment has
also been moved to the `src/event.rs` file.
-rw-r--r-- | src/config.rs | 6 | ||||
-rw-r--r-- | src/display.rs | 9 | ||||
-rw-r--r-- | src/event.rs | 7 |
3 files changed, 13 insertions, 9 deletions
diff --git a/src/config.rs b/src/config.rs index 7e4ee1d2..6b2377e5 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1597,9 +1597,9 @@ fn deserialize_scale_with_dpi<'a, D>(deserializer: D) -> ::std::result::Result<O let _ignored = bool::deserialize(deserializer); eprintln!("{}", Yellow("The `scale_with_dpi` setting has been removed, \ - on X11 the WINIT_HIDPI_FACTOR environment variable can be used instead.")); - Ok(None) - + on X11 the WINIT_HIDPI_FACTOR environment variable can be used instead.") + ); + Ok(None) } fn default_bold_desc() -> FontDescription { diff --git a/src/display.rs b/src/display.rs index bf10e2a4..1143fdd8 100644 --- a/src/display.rs +++ b/src/display.rs @@ -286,9 +286,6 @@ impl Display { // Take most recent resize event, if any while let Ok(size) = self.rx.try_recv() { - // Resize events are emitted via glutin/winit with logical sizes - // However the terminal, window and renderer use physical sizes - // so a conversion must be done here new_size = Some(size); } @@ -305,8 +302,10 @@ impl Display { if new_size == None { // Force a resize to refresh things - new_size = Some(PhysicalSize::new(f64::from(self.size_info.width), - f64::from(self.size_info.height))); + new_size = Some(PhysicalSize::new( + f64::from(self.size_info.width), + f64::from(self.size_info.height), + )); } } diff --git a/src/event.rs b/src/event.rs index 25263541..7a4b99da 100644 --- a/src/event.rs +++ b/src/event.rs @@ -317,7 +317,12 @@ impl<N: Notify> Processor<N> { ::std::process::exit(0); }, Resized(lsize) => { - resize_tx.send(lsize.to_physical(processor.ctx.size_info.dpr)).expect("send new size"); + // Resize events are emitted via glutin/winit with logical sizes + // However the terminal, window and renderer use physical sizes + // so a conversion must be done here + resize_tx + .send(lsize.to_physical(processor.ctx.size_info.dpr)) + .expect("send new size"); processor.ctx.terminal.dirty = true; }, KeyboardInput { input, .. } => { |