Fixed TextureAtlas import wrong images size.

Fix #42057

(cherry picked from commit 395ab3441d)
This commit is contained in:
dankan1890 2020-09-16 01:26:56 +02:00 committed by Rémi Verschelde
parent b63016c571
commit 6f6102f22c
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -128,9 +128,9 @@ static void _plot_triangle(Vector2 *vertices, const Vector2 &p_offset, bool p_tr
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);
for (int yi = y[0]; yi <= max_y; yi++) {
for (int yi = y[0]; yi < max_y; yi++) {
if (yi >= 0) {
for (int xi = (xf > 0 ? int(xf) : 0); xi <= (xt < width ? xt : width - 1); xi++) {
for (int xi = (xf > 0 ? int(xf) : 0); xi < (xt < width ? xt : width - 1); xi++) {
int px = xi, py = yi;
int sx = px, sy = py;
sx = CLAMP(sx, 0, src_width - 1);