Skip to content

Commit

Permalink
bugfix #436 which endless loop in clip::clip_line_segment_to_rect method
Browse files Browse the repository at this point in the history
  • Loading branch information
liaojian authored and liaojian committed Aug 29, 2020
1 parent e858c8d commit 7a92724
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/src/clip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7a92724

Please sign in to comment.