Skip to content

Commit

Permalink
Run cargo fmt on winit 0.22 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yodaldevoid committed May 18, 2020
1 parent 02545f9 commit 59c67e7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions imgui-winit-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ use winit::{
TouchPhase, VirtualKeyCode, Window, WindowEvent,
};

#[cfg(any(feature = "winit-20", feature ="winit-22"))]
#[cfg(any(feature = "winit-20", feature = "winit-22"))]
use winit::{
error::ExternalError,
event::{
Expand Down Expand Up @@ -213,7 +213,7 @@ impl WinitPlatform {
///
/// * framebuffer scale (= DPI factor) is set
/// * display size is set
#[cfg(any(feature = "winit-20", feature ="winit-22"))]
#[cfg(any(feature = "winit-20", feature = "winit-22"))]
pub fn attach_window(&mut self, io: &mut Io, window: &Window, hidpi_mode: HiDpiMode) {
let (hidpi_mode, hidpi_factor) = hidpi_mode.apply(window.scale_factor());
self.hidpi_mode = hidpi_mode;
Expand Down Expand Up @@ -246,7 +246,7 @@ impl WinitPlatform {
///
/// This utility function is useful if you are using a DPI mode other than default, and want
/// your application to use the same logical coordinates as imgui-rs.
#[cfg(any(feature = "winit-20", feature ="winit-22"))]
#[cfg(any(feature = "winit-20", feature = "winit-22"))]
pub fn scale_size_from_winit(
&self,
window: &Window,
Expand Down Expand Up @@ -280,7 +280,7 @@ impl WinitPlatform {
///
/// This utility function is useful if you are using a DPI mode other than default, and want
/// your application to use the same logical coordinates as imgui-rs.
#[cfg(any(feature = "winit-20", feature ="winit-22"))]
#[cfg(any(feature = "winit-20", feature = "winit-22"))]
pub fn scale_pos_from_winit(
&self,
window: &Window,
Expand Down Expand Up @@ -314,7 +314,7 @@ impl WinitPlatform {
///
/// This utility function is useful if you are using a DPI mode other than default, and want
/// your application to use the same logical coordinates as imgui-rs.
#[cfg(any(feature = "winit-20", feature ="winit-22"))]
#[cfg(any(feature = "winit-20", feature = "winit-22"))]
pub fn scale_pos_for_winit(
&self,
window: &Window,
Expand Down Expand Up @@ -441,11 +441,11 @@ impl WinitPlatform {
// we might never see the release event if some other window gets focus.
Event::DeviceEvent {
event:
DeviceEvent::Key(KeyboardInput {
state: ElementState::Released,
virtual_keycode: Some(key),
..
}),
DeviceEvent::Key(KeyboardInput {
state: ElementState::Released,
virtual_keycode: Some(key),
..
}),
..
} => {
io.keys_down[key as usize] = false;
Expand Down Expand Up @@ -663,7 +663,7 @@ impl WinitPlatform {
/// This function performs the following actions:
///
/// * mouse cursor is repositioned (if requested by imgui-rs)
#[cfg(any(feature = "winit-20", feature ="winit-22"))]
#[cfg(any(feature = "winit-20", feature = "winit-22"))]
pub fn prepare_frame(&self, io: &mut Io, window: &Window) -> Result<(), ExternalError> {
if io.want_set_mouse_pos {
let logical_pos = self.scale_pos_for_winit(
Expand Down Expand Up @@ -713,7 +713,7 @@ impl WinitPlatform {
/// This function performs the following actions:
///
/// * mouse cursor is changed and/or hidden (if requested by imgui-rs)
#[cfg(any(feature = "winit-20", feature ="winit-22"))]
#[cfg(any(feature = "winit-20", feature = "winit-22"))]
pub fn prepare_render(&self, ui: &Ui, window: &Window) {
let io = ui.io();
if !io
Expand Down

0 comments on commit 59c67e7

Please sign in to comment.