Merge pull request #221 from agersant/drag-delta

Exposed GetMouseDragDelta()
This commit is contained in:
Joonas Javanainen 2019-06-03 21:09:07 +03:00 committed by GitHub
commit 713af16554
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,6 +271,12 @@ 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) {