(&self, ctx: &C, percent: f64, highlight: bool)
| 42 | C: CanvasContext<Pattern>, |
| 43 | { |
| 44 | fn draw(&self, ctx: &C, percent: f64, highlight: bool) { |
| 45 | let x = lerp(self.old_left, self.left, percent); |
| 46 | let h = lerp(self.old_height, self.height, percent); |
| 47 | let w = lerp(self.old_width, self.width, percent); |
| 48 | let y = self.bottom - h; |
| 49 | |
| 50 | ctx.set_fill_color(self.color); |
| 51 | ctx.fill_rect(x, y, w, h); |
| 52 | if highlight { |
| 53 | ctx.set_fill_color(Color::RGBA(255, 255, 255, 25)); |
| 54 | ctx.fill_rect(x, y, w, h); |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | impl<D> Entity for BarEntity<D> { |
no test coverage detected