mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-04 15:08:11 +08:00
Bezier-rs: Implement miter-limit (#1096)
* Implement miter-limit approximation * Refactor to use Join enum and address other comments * Rustdocs improvements * Tweaks --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
parent
3733804d18
commit
97be83c404
@@ -14,17 +14,17 @@ impl<ManipulatorGroupId: crate::Identifier> Subpath<ManipulatorGroupId> {
|
||||
self.closed = new_closed;
|
||||
}
|
||||
|
||||
/// Access a [ManipulatorGroup] from a [ManipulatorGroupId].
|
||||
/// Access a [ManipulatorGroup] from a ManipulatorGroupId.
|
||||
pub fn manipulator_from_id(&self, id: ManipulatorGroupId) -> Option<&ManipulatorGroup<ManipulatorGroupId>> {
|
||||
self.manipulator_groups.iter().find(|manipulator_group| manipulator_group.id == id)
|
||||
}
|
||||
|
||||
/// Access a mutable [ManipulatorGroup] from a [ManipulatorGroupId].
|
||||
/// Access a mutable [ManipulatorGroup] from a ManipulatorGroupId.
|
||||
pub fn manipulator_mut_from_id(&mut self, id: ManipulatorGroupId) -> Option<&mut ManipulatorGroup<ManipulatorGroupId>> {
|
||||
self.manipulator_groups.iter_mut().find(|manipulator_group| manipulator_group.id == id)
|
||||
}
|
||||
|
||||
/// Access the index of a [ManipulatorGroup] from a [ManipulatorGroupId].
|
||||
/// Access the index of a [ManipulatorGroup] from a ManipulatorGroupId.
|
||||
pub fn manipulator_index_from_id(&self, id: ManipulatorGroupId) -> Option<usize> {
|
||||
self.manipulator_groups.iter().position(|manipulator_group| manipulator_group.id == id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user