Skip to content

Commit

Permalink
Add text_brush method
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Jul 22, 2024
1 parent 67faee6 commit 0492eb3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions parley/src/editor/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ pub enum TextBrush {
},
}

impl TextBrush {
pub fn text_brush(&self) -> &peniko::Brush {
match self {
TextBrush::Normal(brush) => brush,
TextBrush::Highlight { text, .. } => text,
}
}
}

impl From<peniko::Brush> for TextBrush {
fn from(value: peniko::Brush) -> Self {
Self::Normal(value)
Expand Down

0 comments on commit 0492eb3

Please sign in to comment.