mirror of
https://github.com/penpot/penpot.git
synced 2025-07-19 00:47:18 +02:00
🐛 Fix caps for rounded paths
This commit is contained in:
parent
8db910baee
commit
78d6166bac
2 changed files with 8 additions and 6 deletions
|
@ -187,9 +187,11 @@ fn handle_stroke_caps(
|
|||
scale: f32,
|
||||
antialias: bool,
|
||||
) {
|
||||
let points_count = path.count_points();
|
||||
let mut points = vec![Point::default(); points_count];
|
||||
let c_points = path.get_points(&mut points);
|
||||
let mut points = vec![Point::default(); path.count_points()];
|
||||
path.get_points(&mut points);
|
||||
// Curves can have duplicated points, so let's remove consecutive duplicated points
|
||||
points.dedup();
|
||||
let c_points = points.len();
|
||||
|
||||
// Closed shapes don't have caps
|
||||
if c_points >= 2 && is_open {
|
||||
|
@ -213,7 +215,7 @@ fn handle_stroke_caps(
|
|||
stroke.width,
|
||||
&mut paint_stroke,
|
||||
last_point,
|
||||
&points[points_count - 2],
|
||||
&points[c_points - 2],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue