MCPcopy Index your code
hub / github.com/FrameworkComputer/inputmodule-rs / clear_text

Function clear_text

fl16-inputmodules/src/graphics.rs:15–28  ·  view source on GitHub ↗
(target: &mut D, offset: Point, color: Rgb565)

Source from the content-addressed store, hash-verified

13pub const LOGO_OFFSET_Y: i32 = 100;
14
15pub fn clear_text<D>(target: &mut D, offset: Point, color: Rgb565) -> Result<(), D::Error>
16where
17 D: DrawTarget<Color = Rgb565>,
18{
19 const TEXT_H: i32 = 20;
20 Rectangle::new(
21 Point::new(0, 30) + offset - Point::new(0, 15),
22 Size::new(130, TEXT_H as u32),
23 )
24 .into_styled(PrimitiveStyle::with_fill(color))
25 .draw(target)?;
26
27 Ok(())
28}
29
30pub fn draw_text<D>(target: &mut D, target_text: &str, offset: Point) -> Result<(), D::Error>
31where

Callers 1

handle_commandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected