Merge pull request #42103 from dankan1890/import_atlas_fix

This commit is contained in:
Rémi Verschelde 2021-09-20 16:09:36 +02:00 committed by GitHub
commit 2d1699ef82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,9 +131,9 @@ static void _plot_triangle(Vector2i *vertices, const Vector2i &p_offset, bool p_
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);