egui_canvas 0.1.2

A TKinter-like canvas widget for egui.
Documentation
use egui::{Pos2, PointerButton};
use std::fmt::Debug;

/// This struct represents the information about a click event, passed to a
/// click handler function of a [`Canvas`](crate::Canvas).
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ClickEvent {
    pub button: PointerButton,
    pub pos: Pos2
}

impl ClickEvent {
    /// Constructs a new [`ClickEvent`] object.
    ///
    /// **NEITHER SHOULD THIS NOT BE USED MANUALLY**, nor is there any
    /// reason to do so.
    pub const fn new(button: PointerButton, pos: Pos2) -> Self {
        Self { button, pos }
    }
}