Open abergmeier opened 7 months ago
Can confirm, it does not compile with the following error:
error[E0277]: the trait bound `epd_waveshare::epd7in5_v2::Display7in5: DrawTarget` is not satisfied
--> src/main.rs:107:11
|
107 | text.draw(&mut display).unwrap();
| ---- ^^^^^^^^^^^^ the trait `DrawTarget` is not implemented for `epd_waveshare::epd7in5_v2::Display7in5`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `DrawTarget`:
mono_font::draw_target::MonoFontDrawTarget<'_, T, mono_font::draw_target::Foreground<<T as DrawTarget>::Color>>
mono_font::draw_target::MonoFontDrawTarget<'_, T, mono_font::draw_target::Background<<T as DrawTarget>::Color>>
mono_font::draw_target::MonoFontDrawTarget<'_, T, mono_font::draw_target::Both<<T as DrawTarget>::Color>>
Clipped<'_, T>
ColorConverted<'_, T, C>
Cropped<'_, T>
embedded_graphics::draw_target::Translated<'_, T>
Framebuffer<C, RawU1, BO, WIDTH, HEIGHT, N>
and 10 others
note: required by a bound in `embedded_graphics::Drawable::draw`
--> /home/jowe/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embedded-graphics-core-0.4.0/src/drawable.rs:106:12
|
104 | fn draw<D>(&self, target: &mut D) -> Result<Self::Output, D::Error>
| ---- required by a bound in this associated function
105 | where
106 | D: DrawTarget<Color = Self::Color>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Drawable::draw`
In generally, I've tried this with Display4in2, and does not compile either. The relevant crates I used are:
epd-waveshare = {version="0.5.0", features=["graphics"]}
embedded-hal = "0.2.4"
embedded-hal-compat = "0.13.0"
embedded-graphics = "0.8.1"
By digging a bit, I found PR #196 which seems to fix this problem. One can add .color_converted()
to the parameter in the draw()
-function. This function seems to exist in version 0.5.0
already, but is still not working in this case outside of that PR.
I have the following code:
which does not compile due to a
BinaryColor
<>Color
mismatch.