pub fn count_for_click(&self, click_pos: Point) -> u8 {
        let click_time = Instant::now();
        let last_time = self.last_click.replace(click_time);
        let last_pos = self.last_pos.replace(click_pos);
        let elapsed = click_time - last_time;
        let distance = last_pos.distance(click_pos);
        if elapsed > self.max_interval.get() || distance > self.max_distance.get() {
            self.click_count.set(0);
        }
        let click_count = self.click_count.get().saturating_add(1);
        self.click_count.set(click_count);
        click_count
    }
/// Return the click count for a click occuring now, at the provided position.
Return the click count for a click occuring now, at the provided position.
Return the click count for a click occuring now at the provided position .
pub fn count_for_click(&self, click_pos: Point) -> u8 {
        let click_time = Instant::now();
        let last_time = self.last_click.replace(click_time);
        let last_pos = self.last_pos.replace(click_pos);
        let elapsed = click_time - last_time;
        let distance = last_pos.distance(click_pos);
        if elapsed > self.max_interval.get() || distance > self.max_distance.get() {
            self.click_count.set(0);
        }
        let click_count = self.click_count.get().saturating_add(1);
        self.click_count.set(click_count);
        click_count
    }
pub fn count_for_click ( & self , click_pos : Point ) -> u8 { let click_time = Instant :: now ( ) ; let last_time = self . last_click . replace ( click_time ) ; let last_pos = self . last_pos . replace ( click_pos ) ; let elapsed = click_time - last_time ; let distance = last_pos . distance ( click_pos ) ; if elapsed > self . max_interval . get ( ) || distance > self . max_distance . get ( ) { self . click_count . set ( 0 ) ; } let click_count = self . click_count . get ( ) . saturating_add ( 1 ) ; self . click_count . set ( click_count ) ; click_count }
Return the click count for a click occuring now, at the provided position.
Return the click count for a click occuring now at the provided position .
&self
click_pos
Point
&self
click_pos
Point