Skip to content

Commit

Permalink
Add round for text (#861)
Browse files Browse the repository at this point in the history
  • Loading branch information
namse authored Jun 19, 2024
1 parent ce5b357 commit 97654f4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions luda-editor/client/src/components/tool_tip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ impl Component for ToolTip {
right: 4.px(),
bottom: 4.px(),
}),
..Default::default()
}),
line_height_percent: 100.percent(),
underline: None,
Expand Down
2 changes: 2 additions & 0 deletions namui/namui/src/namui/render/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub struct TextStyleDropShadow {
pub struct TextStyleBackground {
pub color: Color,
pub margin: Option<Ltrb<Px>>,
pub round: Option<Px>,
}
#[derive(Clone, Debug)]
pub struct TextStyle {
Expand Down Expand Up @@ -183,6 +184,7 @@ fn draw_background(param: &TextParam, font: &Font) -> RenderingTree {
fill: Some(RectFill {
color: background.color,
}),
round: background.round.map(|round| RectRound { radius: round }),
..Default::default()
},
})
Expand Down
2 changes: 1 addition & 1 deletion namui/sample/register-font/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Component for FontExample {
color: Color::WHITE,
background: Some(TextStyleBackground {
color: Color::BLACK,
margin: None,
..Default::default()
}),
line_height_percent: 100.percent(),
underline: None,
Expand Down
2 changes: 1 addition & 1 deletion quick/src/block/row_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl<'a> RowBlock<'a> {
color: Color::grayscale_f01(0.8),
background: Some(TextStyleBackground {
color: crate::color::BACKGROUND,
margin: None,
..Default::default()
}),
..Default::default()
},
Expand Down
2 changes: 1 addition & 1 deletion quick/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl Link {
color: Color::grayscale_f01(1.8),
background: Some(TextStyleBackground {
color: crate::color::BACKGROUND,
margin: None,
..Default::default()
}),
underline: Some(
PaintBuilder::new()
Expand Down

0 comments on commit 97654f4

Please sign in to comment.