diff options
| -rw-r--r-- | teensy/teensy_renderer.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/teensy/teensy_renderer.c b/teensy/teensy_renderer.c index 2104695..da35738 100644 --- a/teensy/teensy_renderer.c +++ b/teensy/teensy_renderer.c @@ -129,10 +129,10 @@ void ty_draw_clear(struct ty_color col) void ty_draw_image(struct ty_image img, struct ty_vec2i pos) { - int x1 = fmin(fmax(floor(pos.x), 0), r.screen.width); - int y1 = fmin(fmax(floor(pos.y), 0), r.screen.height); - int x2 = fmin(fmax(floor(pos.x + img.width), 0), r.screen.width); - int y2 = fmin(fmax(floor(pos.y + img.height), 0), r.screen.height); + int x1 = fmin(fmax(pos.x, 0), r.screen.width); + int y1 = fmin(fmax(pos.y, 0), r.screen.height); + int x2 = fmin(fmax(pos.x + img.width, 0), r.screen.width); + int y2 = fmin(fmax(pos.y + img.height, 0), r.screen.height); for (int dy = y1; dy < y2; dy++) { for (int dx = x1; dx < x2; dx++) { @@ -156,10 +156,10 @@ void ty_draw_image_ex( struct ty_recti src, struct ty_recti dst ) { - int x1 = fmin(fmax(floor(dst.x), 0), r.screen.width); - int y1 = fmin(fmax(floor(dst.y), 0), r.screen.height); - 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); + int x1 = fmin(fmax(dst.x, 0), r.screen.width); + int y1 = fmin(fmax(dst.y, 0), r.screen.height); + int x2 = fmin(fmax(dst.x + dst.w, 0), r.screen.width); + int y2 = fmin(fmax(dst.y + dst.h, 0), r.screen.height); for (int dy = y1; dy < y2; dy++) { for (int dx = x1; dx < x2; dx++) { |
