Skip to content

Commit

Permalink
#72 add Clone
Browse files Browse the repository at this point in the history
  • Loading branch information
wtholliday committed Jan 22, 2025
1 parent 3caa9ec commit 91eedb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub trait Modifiers: View + Sized {
}

/// Adds a menu command.
fn command<F: Fn(&mut Context) + 'static>(
fn command<F: Fn(&mut Context) + Clone + 'static>(
self,
name: &str,
key: Option<HotKey>,
Expand Down
4 changes: 2 additions & 2 deletions src/views/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub struct Canvas<F> {

impl<F> View for Canvas<F>
where
F: Fn(&mut Context, LocalRect, &mut Vger) + 'static,
F: Fn(&mut Context, LocalRect, &mut Vger) + Clone + 'static,
{
fn draw(&self, path: &mut IdPath, args: &mut DrawArgs) {
let rect = args.cx.get_layout(path).rect;
Expand Down Expand Up @@ -45,7 +45,7 @@ where
}

/// Canvas for GPU drawing with Vger. See https://github.com/audulus/vger-rs.
pub fn canvas<F: Fn(&mut Context, LocalRect, &mut Vger) + 'static>(f: F) -> impl View {
pub fn canvas<F: Fn(&mut Context, LocalRect, &mut Vger) + Clone + 'static>(f: F) -> impl View {
Canvas { func: f }
}

Expand Down

0 comments on commit 91eedb7

Please sign in to comment.