Merge pull request #438 from colorhook/master

bugfix #436 which endless loop in clip::clip_line_segment_to_rect method
This commit is contained in:
Patrick Walton 2020-09-09 19:43:52 -07:00 committed by GitHub
commit badf37afcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -529,12 +529,12 @@ pub fn clip_line_segment_to_rect(mut line_segment: LineSegment2F, rect: RectF)
(line_segment.min_y() - line_segment.from_y()) /
(line_segment.max_y() - line_segment.min_y())),
rect.min_y());
} else if outcode.contains(Outcode::LEFT) {
} else if outcode.contains(Outcode::BOTTOM) {
point = vec2f(lerp(line_segment.from_x(),
line_segment.to_x(),
(line_segment.max_y() - line_segment.from_y()) /
(line_segment.max_y() - line_segment.min_y())),
rect.min_y());
rect.max_y());
}
if clip_from {