Skip to content

Commit

Permalink
src/__init__.py test/: removed too-strict assert when creating IRect.
Browse files Browse the repository at this point in the history
This addresses #3163.
  • Loading branch information
julian-smith-artifex-com committed Feb 15, 2024
1 parent 6487e41 commit 1daf2c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20308,7 +20308,6 @@ def util_make_irect( *args, p0=None, p1=None, x0=None, y0=None, x1=None, y1=None
a, b, c, d = util_make_rect( *args, p0=p0, p1=p1, x0=x0, y0=y0, x1=x1, y1=y1)
def convert(x):
ret = int(x)
assert ret == x
return ret
a = convert(a)
b = convert(b)
Expand Down
4 changes: 4 additions & 0 deletions tests/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,7 @@ def test_pageboxes():
for key in keys:
assert doc.xref_get_key(page.xref, key) == ("array", "[100 142 400 642]")
assert page.cropbox == page.artbox == page.bleedbox == page.trimbox

def test_3163():
b = {'number': 0, 'type': 0, 'bbox': (403.3577880859375, 330.8871765136719, 541.2731323242188, 349.5766296386719), 'lines': [{'spans': [{'size': 14.0, 'flags': 4, 'font': 'SFHello-Medium', 'color': 1907995, 'ascender': 1.07373046875, 'descender': -0.26123046875, 'text': 'Inclusion and diversity', 'origin': (403.3577880859375, 345.9194030761719), 'bbox': (403.3577880859375, 330.8871765136719, 541.2731323242188, 349.5766296386719)}], 'wmode': 0, 'dir': (1.0, 0.0), 'bbox': (403.3577880859375, 330.8871765136719, 541.2731323242188, 349.5766296386719)}]}
bbox = fitz.IRect(b["bbox"])

0 comments on commit 1daf2c4

Please sign in to comment.