Implement basic cursor availability

This commit is contained in:
Héctor Ramón Jiménez 2023-06-08 20:11:59 +02:00
parent c15f1b5f65
commit 34451bff18
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
55 changed files with 731 additions and 886 deletions

View file

@ -1,6 +1,7 @@
use std::fmt::Debug;
use iced::executor;
use iced::mouse;
use iced::widget::canvas::event::{self, Event};
use iced::widget::canvas::{self, Canvas};
use iced::widget::{column, row, slider, text};
@ -105,7 +106,7 @@ impl canvas::Program<Message> for SierpinskiGraph {
_state: &mut Self::State,
event: Event,
bounds: Rectangle,
cursor: canvas::Cursor,
cursor: mouse::Cursor,
) -> (event::Status, Option<Message>) {
let cursor_position =
if let Some(position) = cursor.position_in(&bounds) {
@ -137,7 +138,7 @@ impl canvas::Program<Message> for SierpinskiGraph {
renderer: &Renderer,
_theme: &Theme,
bounds: Rectangle,
_cursor: canvas::Cursor,
_cursor: mouse::Cursor,
) -> Vec<canvas::Geometry> {
let geom = self.cache.draw(renderer, bounds.size(), |frame| {
frame.stroke(