Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autoscale for vertical overflow #386

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/squib/graphics/text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def text(embed, para, box, trans, draw, dpi)
max_fitting_size = sizes.bsearch{ |sz|
font_desc.size = sz
extents = render_text(embed, para, box, trans, draw, dpi, font_desc, orig_font_size, true)
!extents[:ellipsized]
!extents[:ellipsized] && extents[:height] <= box.height
}

if max_fitting_size.nil?
Expand Down Expand Up @@ -171,7 +171,7 @@ def render_text(embed, para, box, trans, draw, dpi, font_desc, orig_font_size, d
end

set_font_rendering_opts!(layout)
set_wh!(layout, box.width, box.height)
set_wh!(layout, box.width, dummy_draw ? -1 : box.height)
layout.wrap = para.wrap
layout.ellipsize = para.ellipsize
layout.alignment = para.align
Expand Down