feat(theme): add roundedraff theme and fix sleep cover crop grid artifacts (#918)

## Summary
- Add new `roundedraff` theme.
- Fix sleep screen artifact where book cover showed grid lines in
`Cover` mode with `Crop`.

## Additional Context
## Key changes
- Added `src/components/themes/roundedraff/` theme implementation.
- Updated sleep cover rendering logic in:
  - `src/activities/boot_sleep/SleepActivity.cpp`
  - `src/activities/boot_sleep/SleepActivity.h`
- Improved cover generation/regeneration paths in:
  - `lib/Epub/Epub.cpp`
  - `lib/Epub/Epub.h`
  - `lib/Txt/Txt.cpp`
  - `lib/Txt/Txt.h`

## Verification
- Sleep screen set to Book cover
- Sleep screen cover mode set to Crop
- Confirmed grid artifacts no longer appear on cover sleep screen.

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**< YES >**_

---------

Co-authored-by: CaptainFrito <yzq6x5zypy@privaterelay.appleid.com>
Co-authored-by: Zach Nelson <zach@zdnelson.com>
Co-authored-by: Uri Tauber <142022451+Uri-Tauber@users.noreply.github.com>
This commit is contained in:
bunsoootchi
2026-04-27 19:01:22 +03:00
committed by GitHub
co-authored by CaptainFrito Zach Nelson Uri Tauber
parent 33386953d9
commit b8a51522ca
18 changed files with 548 additions and 8 deletions
+35
View File
@@ -493,6 +493,41 @@ void GfxRenderer::fillRectDither(const int x, const int y, const int width, cons
}
}
void GfxRenderer::maskRoundedRectOutsideCorners(const int x, const int y, const int width, const int height,
const int radius, const Color color) const {
if (radius <= 0 || color == Color::Clear) {
return;
}
const int rr = radius - 1;
const int rr2 = rr * rr;
for (int dy = 0; dy < radius; dy++) {
for (int dx = 0; dx < radius; dx++) {
const int tx = rr - dx;
const int ty = rr - dy;
if (tx * tx + ty * ty > rr2) {
if (color == Color::White || color == Color::Black) {
bool state = color == Color::Black;
drawPixel(x + dx, y + dy, state); // top-left
drawPixel(x + width - 1 - dx, y + dy, state); // top-right
drawPixel(x + dx, y + height - 1 - dy, state); // bottom-left
drawPixel(x + width - 1 - dx, y + height - 1 - dy, state); // bottom-right
} else if (color == Color::LightGray) {
drawPixelDither<Color::LightGray>(x + dx, y + dy); // top-left
drawPixelDither<Color::LightGray>(x + width - 1 - dx, y + dy); // top-right
drawPixelDither<Color::LightGray>(x + dx, y + height - 1 - dy); // bottom-left
drawPixelDither<Color::LightGray>(x + width - 1 - dx, y + height - 1 - dy); // bottom-right
} else if (color == Color::DarkGray) {
drawPixelDither<Color::DarkGray>(x + dx, y + dy); // top-left
drawPixelDither<Color::DarkGray>(x + width - 1 - dx, y + dy); // top-right
drawPixelDither<Color::DarkGray>(x + dx, y + height - 1 - dy); // bottom-left
drawPixelDither<Color::DarkGray>(x + width - 1 - dx, y + height - 1 - dy); // bottom-right
}
}
}
}
}
template <Color color>
void GfxRenderer::fillArc(const int maxRadius, const int cx, const int cy, const int xDir, const int yDir) const {
if (maxRadius <= 0) return;
+1
View File
@@ -100,6 +100,7 @@ class GfxRenderer {
void drawRoundedRect(int x, int y, int width, int height, int lineWidth, int cornerRadius, bool state) const;
void drawRoundedRect(int x, int y, int width, int height, int lineWidth, int cornerRadius, bool roundTopLeft,
bool roundTopRight, bool roundBottomLeft, bool roundBottomRight, bool state) const;
void maskRoundedRectOutsideCorners(int x, int y, int width, int height, int radius, Color color = Color::White) const;
void fillRect(int x, int y, int width, int height, bool state = true) const;
void fillRectDither(int x, int y, int width, int height, Color color) const;
void fillRoundedRect(int x, int y, int width, int height, int cornerRadius, Color color) const;