-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address #3182: Pixmap.invert_irect argument type error. #3187
Conversation
src/__init__.py
Outdated
@@ -16267,15 +16267,15 @@ def JM_irect_from_py(r): | |||
r = mupdf.FzIrect( r.x0, r.y0, r.x1, r.y1) | |||
return r | |||
if isinstance(r, Rect): | |||
ret = mupdf.fz_make_irect(r.x0, r.y0, r.x1, r.y1) | |||
ret = mupdf.fz_make_irect(int(r.x0), int(r.y0), int(r.x1), int(r.y1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct, because rounding is different from how MuPDF makes a IRect from a Rect: uppper and left coords must be rounded in direction left / up, but lower / right coords must take the next available integer ceiling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle we must first form Rect and then an IRect from the result: fz_irect_from_rect(fz_rect rect).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, i hadn't realised that. New commit fixes hopefully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle we must first form Rect and then an IRect from the result: fz_irect_from_rect(fz_rect rect).
a8acf18
to
9983ce2
Compare
Have added a commit that addresses #3186. |
Address #3182 and #3186.