Skip to content

Commit

Permalink
fix float precision bug in text box rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
unterkoefler committed Feb 16, 2023
1 parent 7d4f6b8 commit 44b871f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/prawn/text/formatted/line_wrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def add_fragment_to_line(fragment)
@document.width_of(segment, kerning: @kerning)
end

if @accumulated_width + segment_width <= @width
if @accumulated_width + segment_width <= @width + 0.00001
@accumulated_width += segment_width
shy = soft_hyphen(segment.encoding)
if segment[-1] == shy
Expand Down

0 comments on commit 44b871f

Please sign in to comment.