Record mouse movement (#51)

* Record mouse movement

* Use get for last_point and first_point

* Use first and las for first_point and last_point

* Remove unnecessary comment

* Derive Default for Trace

Co-authored-by: RustyNixieTube <RustyNixieTube@users.noreply.github.com>
This commit is contained in:
RustyNixieTube
2021-03-28 19:59:41 +02:00
committed by GitHub
co-authored by RustyNixieTube
parent 5ca9c715e5
commit ea1f9f30f0
3 changed files with 44 additions and 9 deletions
+5 -1
View File
@@ -1,7 +1,9 @@
use crate::Color;
use crate::{events::Trace, Color};
use std::collections::HashMap;
pub struct ToolState {
pub mouse_is_clicked: bool,
pub trace: Trace,
pub primary_color: Color,
pub secondary_color: Color,
pub active_tool: ToolType,
@@ -11,6 +13,8 @@ pub struct ToolState {
impl ToolState {
pub fn new() -> Self {
ToolState {
mouse_is_clicked: false,
trace: Trace::new(),
primary_color: Color::BLACK,
secondary_color: Color::WHITE,
active_tool: ToolType::Select,