Skip to content

Commit

Permalink
fix texture size bug when using batched_texture
Browse files Browse the repository at this point in the history
  • Loading branch information
jwvg0425 authored and not-fl3 committed Jan 15, 2024
1 parent aaaf354 commit 912287b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ pub fn draw_texture_ex(
) {
let context = get_context();

let [width, height] = texture.size().to_array();
let [mut width, mut height] = texture.size().to_array();

let Rect {
x: mut sx,
Expand All @@ -378,6 +378,9 @@ pub fn draw_texture_ex(
sw = (sw / width) * uv.w * batched_width;
sh = (sh / height) * uv.h * batched_height;

width = batched_width;
height = batched_height;

batched_texture
});
let texture = texture_opt.as_ref().unwrap_or(texture);
Expand Down

0 comments on commit 912287b

Please sign in to comment.