diff options
| -rw-r--r-- | teensy/renderer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/teensy/renderer.c b/teensy/renderer.c index c507dcd..8cbba84 100644 --- a/teensy/renderer.c +++ b/teensy/renderer.c @@ -137,8 +137,8 @@ void ty_draw_image_ex( int x2 = fmin(fmax(floor(dst.x + dst.w), 0), r.screen.width); int y2 = fmin(fmax(floor(dst.y + dst.h), 0), r.screen.height); - for (int dx = x1; dx < x2; dx++) { - for (int dy = y1; dy < y2; dy++) { + for (int dy = y1; dy < y2; dy++) { + for (int dx = x1; dx < x2; dx++) { int tex_x = ((dx - x1) * src.w) / dst.w + src.x; int tex_y = ((dy - y1) * src.h) / dst.h + src.y; @@ -159,8 +159,8 @@ void ty_draw_rect(struct ty_recti rect, struct ty_color color) int x2 = fmin(fmax(floor(rect.x + rect.w), 0), r.screen.width); int y2 = fmin(fmax(floor(rect.y + rect.h), 0), r.screen.height); - for (int dx = x1; dx < x2; dx++) { - for (int dy = y1; dy < y2; dy++) { + for (int dy = y1; dy < y2; dy++) { + for (int dx = x1; dx < x2; dx++) { ty_img_set_pixel( r.screen, (struct ty_vec2i){dx, dy}, |
