Skip to content

Commit

Permalink
fixed a bug in draw_rectangle_ex()
Browse files Browse the repository at this point in the history
Two vertices had the same uv coordinate, which makes no sense. It now has the same uv coordinates as draw_rectangle()
  • Loading branch information
AdamSlayer authored and not-fl3 committed Feb 14, 2024
1 parent 5587702 commit 64f03a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shapes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ pub fn draw_rectangle_ex(x: f32, y: f32, w: f32, h: f32, params: DrawRectanglePa

#[rustfmt::skip]
let vertices = [
Vertex::new(v[0].x, v[0].y, v[0].z, 0.0, 1.0, params.color),
Vertex::new(v[0].x, v[0].y, v[0].z, 0.0, 0.0, params.color),
Vertex::new(v[1].x, v[1].y, v[1].z, 1.0, 0.0, params.color),
Vertex::new(v[2].x, v[2].y, v[2].z, 1.0, 1.0, params.color),
Vertex::new(v[3].x, v[3].y, v[3].z, 1.0, 0.0, params.color),
Vertex::new(v[3].x, v[3].y, v[3].z, 0.0, 1.0, params.color),
];
let indices: [u16; 6] = [0, 1, 2, 0, 2, 3];

Expand Down

0 comments on commit 64f03a4

Please sign in to comment.