MCPcopy Create free account
hub / github.com/angular-rust/ux-charts / draw

Method draw

src/bar.rs:44–56  ·  view source on GitHub ↗
(&self, ctx: &C, percent: f64, highlight: bool)

Source from the content-addressed store, hash-verified

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
59impl<D> Entity for BarEntity<D> {

Callers 1

draw_channelsMethod · 0.45

Calls 5

disposeMethod · 0.80
update_channelMethod · 0.45
draw_frameMethod · 0.45

Tested by

no test coverage detected