IRect contains method

I’m doing:

import pymupdf

irectA = pymupdf.IRect(0,0,100,100)
irectB = pymupdf.IRect(150,150,100,100)

intersects = irectA.intersects(irectB)
contains = irectA.contains(irectB)

print(f"intersects={intersects}")
print(f"contains={contains}")

If I read this correctly then contains() should be a valid method, IRect - PyMuPDF 1.26.1 documentation, but I get an error with:
AttributeError: 'IRect' object has no attribute 'contains'

Any ideas?

1 Like

This was simply forgotten it looks like. Most of this classes methods and attributes are copies of Rect. We should post a bug here.

I posted one here: Bug with IRect contains method · Issue #4575 · pymupdf/PyMuPDF · GitHub

Fix underway in this PR Address 4575 missing “contains” method in IRect by JorjMcKie · Pull Request #4576 · pymupdf/PyMuPDF

1 Like