Skip to content

Commit fe8d1f0

Browse files
authored
Fix BufferedGraphicsMode::clear() so that it fills all pixels (#201)
* Fix not all pixels being filled on clear(On) Currently `clear()` fills the buffer with `0x01` bytes, which represent 7 dark pixels and 1 bright pixel. We want all pixels bright.
1 parent fe89c35 commit fe8d1f0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ SSD1306 monochrome OLED display.
77

88
## [Unreleased] - ReleaseDate
99

10+
### Fixed
11+
12+
- [#201](https://github.com/jamwaffles/ssd1306/pull/201) Fixed `BufferedGraphicsMode::clear(On)` such that it fills all pixels with `On`, not only some.
13+
1014
## [0.8.3] - 2023-10-09
1115

1216
### Changed

src/mode/buffered_graphics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ where
6969
SIZE: DisplaySize,
7070
{
7171
fn clear_impl(&mut self, value: bool) {
72-
self.mode.buffer.as_mut().fill(value as u8);
72+
self.mode.buffer.as_mut().fill(if value { 0xff } else { 0 });
7373

7474
let (width, height) = self.dimensions();
7575
self.mode.min_x = 0;

0 commit comments

Comments
 (0)