Skip to content
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

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

AThousandShips
Copy link
Member

@AThousandShips AThousandShips commented May 24, 2023

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

@@ -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));
Copy link
Member Author

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

@lawnjelly lawnjelly added the bug label May 26, 2023
@lawnjelly lawnjelly added this to the 3.x milestone May 26, 2023
@AThousandShips AThousandShips marked this pull request as draft May 26, 2023 07:32
@AThousandShips AThousandShips marked this pull request as ready for review May 26, 2023 08:27
Copy link
Member

@lawnjelly lawnjelly left a 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.

@AThousandShips
Copy link
Member Author

@felaugmar would you mind testing again with the new method?

@Calinou Calinou added the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Jun 11, 2023
@akien-mga akien-mga modified the milestones: 3.x, 3.6 Jun 12, 2023
@ghost
Copy link

ghost commented Jun 13, 2023

@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.

@akien-mga akien-mga merged commit f3680a2 into godotengine:3.x Jun 13, 2023
@akien-mga
Copy link
Member

Thanks!

@AThousandShips
Copy link
Member Author

Thank you!

@akien-mga
Copy link
Member

Cherry-picked for 3.5.3.

@akien-mga akien-mga removed the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants