Bug with IRect contains method
Closed this issue · 2 comments
jamie-lemon commented
Description of the bug
The IRect contains method seems to be absent.
How to reproduce the bug
I'm doing:
import pymupdf
irectA = pymupdf.IRect(0,0,100,100)
irectB = pymupdf.IRect(150,150,100,100)
contains = irectA.contains(irectB)
print(f"contains={contains}")
But it has an error with: AttributeError: 'IRect' object has no attribute 'contains'
PyMuPDF version
1.26.1
Operating system
MacOS
Python version
3.13
JorjMcKie commented
We should mirror the corresponding Rect method, which has normally been done.
As a circumvention, you can use the alternative x in irect. This is implemented and does exactly what one would expect from the missing irect.contains(x).
julian-smith-artifex-com commented
Fixed in PyMuPDF-1.26.3.