mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-04 13:30:48 +00:00
Reuse bounding box
This commit is contained in:
parent
9a568bdf17
commit
577cb23304
1 changed files with 3 additions and 6 deletions
|
@ -1229,7 +1229,7 @@ pub fn path_segment_horizontal_ray_intersection_count(orig_seg: &PathSegment, po
|
|||
|
||||
match orig_seg {
|
||||
PathSegment::Cubic(..) => cubic_bezier_horizontal_ray_intersection_count(orig_seg, point),
|
||||
_ => fallback_intersection_count(orig_seg, point),
|
||||
_ => fallback_intersection_count(orig_seg, total_bounding_box, point),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1283,12 +1283,9 @@ fn cubic_bezier_horizontal_ray_intersection_count(cubic: &PathSegment, point: DV
|
|||
count
|
||||
}
|
||||
|
||||
fn fallback_intersection_count(orig_seg: &PathSegment, point: DVec2) -> usize {
|
||||
fn fallback_intersection_count(orig_seg: &PathSegment, bounding_box: Aabb, point: DVec2) -> usize {
|
||||
// Existing implementation for non-cubic segments
|
||||
let mut segments = vec![IntersectionSegment {
|
||||
bounding_box: orig_seg.approx_bounding_box(),
|
||||
seg: *orig_seg,
|
||||
}];
|
||||
let mut segments = vec![IntersectionSegment { bounding_box, seg: *orig_seg }];
|
||||
let mut count = 0;
|
||||
let mut next_segments = Vec::new();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue