mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 16:58:12 +08:00
Add path closing and segment extension to the Pen tool (#753)
* Close paths with pen tool * Issue Z command always at end of path * Small code review style changes * Extending paths * Fix mirror on extend path * Code review tweaks Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
parent
09dace0147
commit
1bcf55939d
@@ -384,18 +384,21 @@ impl Subpath {
|
||||
} else if last_out_handle.is_some() || first_in_handle.is_some() {
|
||||
result.push('Q');
|
||||
write_positions(&mut result, [last_out_handle, first_in_handle, first_in_anchor]);
|
||||
} else {
|
||||
result.push('Z');
|
||||
}
|
||||
} else if command == 'M' {
|
||||
// Update the last moveto position
|
||||
result.push('Z');
|
||||
}
|
||||
// Update the last moveto position
|
||||
else if command == 'M' {
|
||||
(first_in_handle, first_in_anchor) = (in_handle, anchor);
|
||||
result.push(command);
|
||||
write_positions(&mut result, [None, None, anchor]);
|
||||
} else {
|
||||
}
|
||||
// Write other path commands (line to/quadratic to/cubic to)
|
||||
else {
|
||||
result.push(command);
|
||||
write_positions(&mut result, [last_out_handle, in_handle, anchor]);
|
||||
}
|
||||
|
||||
start_new_contour = command == 'Z';
|
||||
last_out_handle = out_handle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user