From 55978a0366542e8360b66d2884114f9d1c86f27f Mon Sep 17 00:00:00 2001 From: Antoine Gersant Date: Tue, 30 Apr 2019 19:43:10 -0700 Subject: [PATCH 1/2] Exposed --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 561b4a7..778166a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -271,6 +271,10 @@ impl ImGui { let io = self.io(); io.mouse_wheel } + pub fn mouse_drag_delta(&self, button: ImMouseButton) -> (f32, f32) { + let delta = unsafe { sys::igGetMouseDragDelta_nonUDT2(button as c_int, -1.0) }; + delta.into() + } /// Set to `true` to have ImGui draw the cursor in software. /// If `false`, the OS cursor is used (default to `false`). pub fn set_mouse_draw_cursor(&mut self, value: bool) { From c11d9dff1559b2bbf1fa89a37fb7bd275e606c2a Mon Sep 17 00:00:00 2001 From: Antoine Gersant Date: Tue, 30 Apr 2019 19:44:09 -0700 Subject: [PATCH 2/2] Formatting --- src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 778166a..4b43905 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -272,7 +272,9 @@ impl ImGui { io.mouse_wheel } pub fn mouse_drag_delta(&self, button: ImMouseButton) -> (f32, f32) { - let delta = unsafe { sys::igGetMouseDragDelta_nonUDT2(button as c_int, -1.0) }; + let delta = unsafe { + sys::igGetMouseDragDelta_nonUDT2(button as c_int, -1.0) + }; delta.into() } /// Set to `true` to have ImGui draw the cursor in software.