Skip to content

Plugins draw their pictures at the block's exact size (M7) - #247

Merged
txoof merged 1 commit into
mainfrom
246-content-size
Oct 7, 2026
Merged

txoof merged 1 commit into
mainfrom
246-content-size

Conversation

@txoof-bot

Copy link
Copy Markdown
Collaborator

Closes #246

What changed

epdlib now tells a plugin the exact size of a block's drawing area (content_size, txoof/epdlib#89). Plugins that draw their own pictures now use it:

  • system_info draws its bars and its two icons at the size of their block. Before, it drew them large (bars 1600x400, icons 240x240) and let the layout shrink them, which left dotted edges on black-and-white screens. Now nothing is resized and the edges are sharp. The bar outline is now the same thickness on all four sides (4% of the bar's short side). Before, stretching made the long sides of a bar much thinner than the short ones.
  • dec_binary_clock, splash_screen and xkcd_comic use content_size instead of the whole block box (and, in splash_screen, its own padding sum). They no longer depend on their block having no padding and no border. Their pictures are unchanged: all their reference images still match.
  • docs/writing-plugins.md: new short section "Pictures the plugin draws itself".
  • epdlib pin moved from b4dd600 to 4633fca (the Unable to get anything on e-paper display after paperpi installation (Display: epd2in13_V2) #89 merge). Only the pin changes in pyproject.toml and uv.lock.

Area

plugins/system_info, plugins/dec_binary_clock, plugins/splash_screen, plugins/xkcd_comic, docs (docs/writing-plugins.md), ci (epdlib pin only), tests.

Tests

  • New: every bar and icon system_info draws has its block's exact size (full and portrait layouts); icons draw at any size (1, 7 and 240 pixels). test_bars passes the size now.
  • Reference images: only the 12 system_info images changed (updated and checked by eye); all other plugins' images are unchanged.
  • uv run pytest passes (1308 passed)
  • uv run ruff check . passes
  • Hardware tests: not needed, no display or driver code changed.

Images

Black-and-white 7.5" screen, before (main) and after:

  • portrait: before, after — the dotted bar edges are gone
  • full: before, after — dotted edges on the bar and the chip icon are gone

Review

  • Review agents' comments answered — not run: small change (+117/−55 lines, without images).

Only txoof approves and merges this PR.

🤖 Generated with Claude Code

system_info draws its bars and icons at the size of their block
(epdlib content_size) instead of drawing them large and letting the
layout shrink them, so their edges stay sharp. dec_binary_clock,
splash_screen and xkcd_comic use content_size instead of the whole
box, so they no longer depend on their block having no padding.
epdlib pin moved to 4633fca.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@txoof-bot
txoof-bot requested a review from txoof as a code owner October 7, 2026 19:07
@txoof
txoof merged commit 646f669 into main Oct 7, 2026
2 checks passed
@txoof
txoof deleted the 246-content-size branch October 7, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugins draw their pictures at the block's exact size (epdlib content_size)

2 participants