From 7a927245480138e43220321fff8bf7db6d3b6fe9 Mon Sep 17 00:00:00 2001 From: liaojian Date: Sun, 30 Aug 2020 01:18:50 +0800 Subject: [PATCH] bugfix #436 which endless loop in clip::clip_line_segment_to_rect method --- content/src/clip.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/src/clip.rs b/content/src/clip.rs index 34fee613..8f03923d 100644 --- a/content/src/clip.rs +++ b/content/src/clip.rs @@ -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 {