Skip to content

Commit

Permalink
Fix rounded corner rendering (#410)
Browse files Browse the repository at this point in the history
still won't work if border_radius < border_width / 2,
since the radius is limited by the stroke width
  • Loading branch information
Long0x0 authored Apr 4, 2024
1 parent 58f5ea3 commit ab125b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ pub(crate) fn paint_border(cx: &mut PaintCx, style: &ViewStyleProps, size: Size)
crate::unit::PxPct::Pct(pct) => size.min_side() * (pct / 100.),
};
if radius > 0.0 {
let radius = (radius - half).max(0.0);
cx.stroke(&rect.to_rounded_rect(radius), border_color, left);
} else {
cx.stroke(&rect, border_color, left);
Expand Down

0 comments on commit ab125b7

Please sign in to comment.