Skip to content

Commit

Permalink
refactor: use engine_view_mut macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Kneemund committed Nov 28, 2024
1 parent be0bd35 commit 7e30c1e
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions crates/rnote-engine/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,27 +847,13 @@ impl Engine {

pub fn text_select_closest_word(&mut self) {
if let Pen::Typewriter(typewriter) = self.penholder.current_pen_mut() {
typewriter.select_closest_word(&mut EngineViewMut {
tasks_tx: self.tasks_tx.clone(),
pens_config: &mut self.pens_config,
document: &mut self.document,
store: &mut self.store,
camera: &mut self.camera,
audioplayer: &mut self.audioplayer,
})
typewriter.select_closest_word(&mut engine_view_mut!(self))
}
}

pub fn text_select_closest_line(&mut self) {
if let Pen::Typewriter(typewriter) = self.penholder.current_pen_mut() {
typewriter.select_closest_line(&mut EngineViewMut {
tasks_tx: self.tasks_tx.clone(),
pens_config: &mut self.pens_config,
document: &mut self.document,
store: &mut self.store,
camera: &mut self.camera,
audioplayer: &mut self.audioplayer,
})
typewriter.select_closest_line(&mut engine_view_mut!(self))
}
}

Expand Down

0 comments on commit 7e30c1e

Please sign in to comment.