test/hexapdf/layout/test_text_layouter.rb in hexapdf-0.22.0 vs test/hexapdf/layout/test_text_layouter.rb in hexapdf-0.23.0
- old
+ new
@@ -644,9 +644,16 @@
@style.valign = :bottom
result = @layouter.fit(@items, 40, 100)
assert_equal(100 - 20 * 2 + 20, result.lines[0].y_offset)
assert_equal(100, result.height)
end
+
+ it "doesn't vertically align when layouting in variable-width mode" do
+ @style.valign = :bottom
+ result = @layouter.fit(@items, proc { 40 }, 100)
+ assert_equal(result.lines[0].y_max, result.lines[0].y_offset)
+ assert_equal(40, result.height)
+ end
end
it "post-processes lines for justification if needed" do
frag10 = HexaPDF::Layout::TextFragment.create(" ", font: @font)
frag10.items.freeze