Skip to content

Commit

Permalink
Merge pull request #131 from canselcik/fixup
Browse files Browse the repository at this point in the history
Fix a couple recent regressions
  • Loading branch information
bkirwi authored Sep 9, 2024
2 parents 8d4fc88 + af54631 commit e9ae246
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/framebuffer/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
}
}
Expand Down
7 changes: 2 additions & 5 deletions src/framebuffer/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
});
}
Expand Down

0 comments on commit e9ae246

Please sign in to comment.