diff --git a/src/framebuffer/core.rs b/src/framebuffer/core.rs index 26da4fe..620cf36 100644 --- a/src/framebuffer/core.rs +++ b/src/framebuffer/core.rs @@ -53,7 +53,7 @@ impl Framebuffer { Model::Gen2 => { // Auto-select old method still if env LIBREMARKABLE_FB_DISFAVOR_INTERNAL_RM2FB is set affirmatively match std::env::var("LIBREMARKABLE_FB_DISFAVOR_INTERNAL_RM2FB").as_deref() { - Ok("1") => Framebuffer::device(device.get_framebuffer_path()), + Ok("1") => Framebuffer::device(Model::Gen1.framebuffer_path()), _ => Framebuffer::rm2fb(device.get_framebuffer_path()), } } diff --git a/src/framebuffer/draw.rs b/src/framebuffer/draw.rs index 5ea3135..d2df6da 100644 --- a/src/framebuffer/draw.rs +++ b/src/framebuffer/draw.rs @@ -191,16 +191,13 @@ impl framebuffer::FramebufferDraw for core::Framebuffer { } glyph.draw(|x, y, v| { + let mult = (1.0 - v).min(1.0); self.write_pixel( Point2 { x: (x + bounding_box.min.x as u32) as i32, y: (y + bounding_box.min.y as u32) as i32, }, - color::RGB( - (255.0 + (c1 - 255.0) * v) as u8, - (255.0 + (c2 - 255.0) * v) as u8, - (255.0 + (c3 - 255.0) * v) as u8, - ), + color::RGB((c1 * mult) as u8, (c2 * mult) as u8, (c3 * mult) as u8), ) }); }