Skip to content

Commit b38b4d9

Browse files
committed
Naming
1 parent 8400135 commit b38b4d9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

node-graph/gcore/src/vector/algorithms/bezpath_algorithms.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,21 @@ pub fn sample_points_on_bezpath(bezpath: BezPath, spacing: f64, start_offset: f6
5151
if sample_count < 1. {
5252
return None;
5353
}
54+
5455
// Generate points along the path based on calculated intervals.
55-
let mut length_upto_previous_segment = 0.;
56+
let mut length_up_to_previous_segment = 0.;
5657
let mut next_segment_index = 0;
5758

5859
for count in 0..=sample_count as usize {
5960
let fraction = count as f64 / sample_count;
60-
let length_upto_next_sample_point = fraction * used_length + start_offset;
61-
let mut next_length = length_upto_next_sample_point - length_upto_previous_segment;
61+
let length_up_to_next_sample_point = fraction * used_length + start_offset;
62+
let mut next_length = length_up_to_next_sample_point - length_up_to_previous_segment;
6263
let mut next_segment_length = segments_length[next_segment_index];
6364

64-
// Keep moving to the next segment while the next sample point length is less or equals to the length upto that segment.
65+
// Keep moving to the next segment while the next sample point length is less or equals to the length up to that segment.
6566
while next_length > next_segment_length && (next_length - next_segment_length) > POSITION_ACCURACY {
66-
length_upto_previous_segment += next_segment_length;
67-
next_length = length_upto_next_sample_point - length_upto_previous_segment;
67+
length_up_to_previous_segment += next_segment_length;
68+
next_length = length_up_to_next_sample_point - length_up_to_previous_segment;
6869
next_segment_index += 1;
6970
next_segment_length = segments_length[next_segment_index];
7071
}
@@ -93,7 +94,7 @@ pub fn t_value_to_parametric(bezpath: &BezPath, t: f64, euclidian: bool, segment
9394
}
9495

9596
/// Finds the t value of point on the given path segment i.e fractional distance along the segment's total length.
96-
/// It uses a binary search to find the value `t` such that the ratio `length_upto_t / total_length` approximates the input `distance`.
97+
/// It uses a binary search to find the value `t` such that the ratio `length_up_to_t / total_length` approximates the input `distance`.
9798
pub fn eval_pathseg_euclidean(path: kurbo::PathSeg, distance: f64, accuracy: f64) -> f64 {
9899
let mut low_t = 0.;
99100
let mut mid_t = 0.5;

0 commit comments

Comments
 (0)