Skip to content
This repository has been archived by the owner on Oct 30, 2021. It is now read-only.

Commit

Permalink
Fixed paths preprocessing.
Browse files Browse the repository at this point in the history
Closes #124
  • Loading branch information
RazrFalcon committed Jan 17, 2018
1 parent 786e808 commit a770837
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/task/paths/conv_segments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ pub fn fix_m(path: &mut Path) {
let prev_cmd = path.d[i - 1].cmd();
let curr_cmd = path.d[i].cmd();

if let &SegmentData::MoveTo { x, y } = path.d[i - 1].data() {
mx = x;
my = y;
}

if prev_cmd == Command::ClosePath {
if curr_cmd != Command::MoveTo {
path.d.insert(i, Segment::new_move_to(mx, my));
}
}

if let &SegmentData::MoveTo { x, y } = path.d[i].data() {
mx = x;
my = y;
}

i += 1;
}
}
Expand Down

0 comments on commit a770837

Please sign in to comment.