(&mut self, x: f64, y: f64, w: f64, h: f64, r: f64, g: f64, b: f64, a: f64)
| 11845 | // ============================================================ |
| 11846 | |
| 11847 | pub fn draw_rect(&mut self, x: f64, y: f64, w: f64, h: f64, r: f64, g: f64, b: f64, a: f64) { |
| 11848 | self.ensure_draw_state(0); |
| 11849 | let color = Self::color_to_f32(r, g, b, a); |
| 11850 | let base = self.vertices_2d.len() as u32; |
| 11851 | let (x, y, w, h) = (x as f32, y as f32, w as f32, h as f32); |
| 11852 | |
| 11853 | self.vertices_2d.push(Vertex2D { position: [x, y], uv: [0.0, 0.0], color }); |
| 11854 | self.vertices_2d.push(Vertex2D { position: [x + w, y], uv: [0.0, 0.0], color }); |
| 11855 | self.vertices_2d.push(Vertex2D { position: [x + w, y + h], uv: [0.0, 0.0], color }); |
| 11856 | self.vertices_2d.push(Vertex2D { position: [x, y + h], uv: [0.0, 0.0], color }); |
| 11857 | |
| 11858 | self.indices_2d.extend_from_slice(&[base, base + 1, base + 2, base, base + 2, base + 3]); |
| 11859 | } |
| 11860 | |
| 11861 | pub fn draw_rect_lines(&mut self, x: f64, y: f64, w: f64, h: f64, thickness: f64, r: f64, g: f64, b: f64, a: f64) { |
| 11862 | let t = thickness; |
no test coverage detected