From 8775ee89b21007aa3c718e25625b4fa8306b553c Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 3 Aug 2021 19:35:30 +0300 Subject: [PATCH] fixed warnings --- rg3d-ui/src/curve/mod.rs | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/rg3d-ui/src/curve/mod.rs b/rg3d-ui/src/curve/mod.rs index e3be4a957..ba1f4b223 100644 --- a/rg3d-ui/src/curve/mod.rs +++ b/rg3d-ui/src/curve/mod.rs @@ -69,8 +69,6 @@ enum OperationContext { initial_view_pos: Vector2, }, DragTangent { - // In local coordinates. - initial_mouse_pos: Vector2, key: usize, left: bool, }, @@ -90,16 +88,6 @@ enum PickResult { RightTangent(usize), } -impl PickResult { - fn key(self) -> usize { - match self { - PickResult::Key(k) => k, - PickResult::LeftTangent(k) => k, - PickResult::RightTangent(k) => k, - } - } -} - impl Selection { fn single_key(key: usize) -> Self { let mut keys = HashSet::new(); @@ -191,7 +179,6 @@ impl> Control for CurveEditor { Selection::LeftTangent { key } | Selection::RightTangent { key } => { selected = i == *key; } - _ => {} } } @@ -261,11 +248,7 @@ impl> Control for CurveEditor { let delta = (pos - initial_mouse_pos).scale(1.0 / self.zoom); self.view_position = initial_view_pos + delta; } - OperationContext::DragTangent { - initial_mouse_pos, - key, - left, - } => { + OperationContext::DragTangent { key, left } => { let key_pos = self.keys[*key].position; let screen_key_pos = self.point_to_screen_space(key_pos); let key = &mut self.keys[*key]; @@ -307,7 +290,6 @@ impl> Control for CurveEditor { Selection::LeftTangent { key } => { self.operation_context = Some(OperationContext::DragTangent { - initial_mouse_pos: local_mouse_pos, key: *key, left: true, }) @@ -315,7 +297,6 @@ impl> Control for CurveEditor { Selection::RightTangent { key } => { self.operation_context = Some(OperationContext::DragTangent { - initial_mouse_pos: local_mouse_pos, key: *key, left: false, }) @@ -543,10 +524,6 @@ impl> CurveEditor { ) } - fn clear_selection(&mut self) { - self.selection = None; - } - // TODO: Fix. fn draw_grid(&self, ctx: &mut DrawingContext) { let screen_bounds = self.screen_bounds();