-
-
Notifications
You must be signed in to change notification settings - Fork 201
set_at now take intptr_t
for x, y instead of int, and guards 32-bit architectures
#2962
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
base: main
Are you sure you want to change the base?
set_at now take intptr_t
for x, y instead of int, and guards 32-bit architectures
#2962
Conversation
c612961
to
1dc41d6
Compare
I don't like how the problem is solved, we aren't clamping the line in the clip rect so we have to check if each pixel of the line one by one are outside the clip rect. IMO, the best way to solve this problem is to delimit with new coordinates which part of the line is going to be drawn. |
1dc41d6
to
4691737
Compare
intptr_t
for x, y instead of int, and guards 32-bit architectures
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.
LGTM, thanks 🎉
I think this could be simpler by using The math being done is not really about pointers so its also strange to put it in a pointer type. |
Gave it a test and just bringing in x and y as long longs in the set_at function call worked. It brings the changes to draw.c from 41 lines to 2 lines (because now the function definition spills onto 2 lines). |
@Starbuck5 blame Ankith on those last two comments of yours. That's what I originally had |
My reasoning for using |
Fixes #2961
@ankith26 figured out that it was an
int
overflow when multiplyingsurf->pitch
byy