mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 02:06:18 +03:00
Only check width and height of transposed fonts once
This commit is contained in:
parent
b27794fc01
commit
fa6cd4a195
|
@ -314,11 +314,8 @@ def test_rotated_transposed_font(font, orientation):
|
||||||
bbox_b[2] - bbox_b[0],
|
bbox_b[2] - bbox_b[0],
|
||||||
)
|
)
|
||||||
|
|
||||||
# Check bbox b is (20, 20, 20 + h, 20 + w)
|
# Check top left co-ordinates are correct
|
||||||
assert bbox_b[0] == 20
|
assert bbox_b[:2] == (20, 20)
|
||||||
assert bbox_b[1] == 20
|
|
||||||
assert bbox_b[2] == 20 + bbox_a[3] - bbox_a[1]
|
|
||||||
assert bbox_b[3] == 20 + bbox_a[2] - bbox_a[0]
|
|
||||||
|
|
||||||
# text length is undefined for vertical text
|
# text length is undefined for vertical text
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
|
@ -360,11 +357,8 @@ def test_unrotated_transposed_font(font, orientation):
|
||||||
bbox_b[3] - bbox_b[1],
|
bbox_b[3] - bbox_b[1],
|
||||||
)
|
)
|
||||||
|
|
||||||
# Check bbox b is (20, 20, 20 + w, 20 + h)
|
# Check top left co-ordinates are correct
|
||||||
assert bbox_b[0] == 20
|
assert bbox_b[:2] == (20, 20)
|
||||||
assert bbox_b[1] == 20
|
|
||||||
assert bbox_b[2] == 20 + bbox_a[2] - bbox_a[0]
|
|
||||||
assert bbox_b[3] == 20 + bbox_a[3] - bbox_a[1]
|
|
||||||
|
|
||||||
assert length_a == length_b
|
assert length_a == length_b
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user