-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
[3.x] Bounds fixes in TextureAtlas
import
#77428
Conversation
831f79b
to
6affb2a
Compare
@@ -129,7 +130,7 @@ static void _plot_triangle(Vector2 *vertices, const Vector2 &p_offset, bool p_tr | |||
double dx_low = double(x[2] - x[1]) / (y[2] - y[1] + 1); | |||
double xf = x[0]; | |||
double xt = x[0] + dx_upper; // if y[0] == y[1], special case | |||
int max_y = MIN(y[2], height - p_offset.y - 1); | |||
int max_y = MIN(y[2], p_transposed ? (width - p_offset.x - 1) : (height - p_offset.y - 1)); |
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.
Required to not clip triangles that are transposed or they will be capped by the wrong dimension
6affb2a
to
5f88c4e
Compare
5f88c4e
to
e34619a
Compare
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.
Haven't tested, but the code looks fine.
@felaugmar would you mind testing again with the new method? |
The artifact is already expired, but I think it'll work, the code change makes sense. |
Thanks! |
Thank you! |
Cherry-picked for 3.5.3. |
Partial backport of #68380, without any new properties, only ensures bounds are fixed, it also does not change the way the alpha threshold is managed, can add that here too if desired
3.x will still suffer from some of the issues in
BitMap
solved by #68732, will see if I can backport them separately