mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-27 23:58:12 +08:00
Fix path being closed when resampling (#1542)
This commit is contained in:
@@ -38,12 +38,12 @@ impl<ManipulatorGroupId: crate::Identifier> Subpath<ManipulatorGroupId> {
|
|||||||
let mut accumulator = 0.;
|
let mut accumulator = 0.;
|
||||||
for (index, length) in lengths.iter().enumerate() {
|
for (index, length) in lengths.iter().enumerate() {
|
||||||
let length_ratio = length / total_length;
|
let length_ratio = length / total_length;
|
||||||
if accumulator <= global_t && global_t <= accumulator + length_ratio {
|
if (index == 0 || accumulator <= global_t) && global_t <= accumulator + length_ratio {
|
||||||
return (index, (global_t - accumulator) / length_ratio);
|
return (index, ((global_t - accumulator) / length_ratio).clamp(0., 1.));
|
||||||
}
|
}
|
||||||
accumulator += length_ratio;
|
accumulator += length_ratio;
|
||||||
}
|
}
|
||||||
(0, 0.)
|
(self.len() - 2, 1.)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert a [SubpathTValue] to a parametric `(segment_index, t)` tuple.
|
/// Convert a [SubpathTValue] to a parametric `(segment_index, t)` tuple.
|
||||||
|
|||||||
Reference in New Issue
Block a user