Skip to content

Smooth shadows and halo, crisp subchat tree lines - #478

Open
tpm28 wants to merge 2 commits into
devfrom
fix/pixel-rendering
Open

tpm28 wants to merge 2 commits into
devfrom
fix/pixel-rendering

Conversation

@tpm28

@tpm28 tpm28 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Rendering that looked rough at the pixel level: the composer's amber halo, the shadows of dialogs and menus, and the subchat tree's line.

What was wrong

  • Halo and shadows: four translucent rounded rectangles, each 3 px larger than the last, imitated a blur. Their edges showed as steps, and the halo ended on a visible line. The composer's dark shadow was drawn over the halo, which hid it on the sides.
  • Subchat tree: the bend into the last subchat was four short Fyne lines. Fyne rounds each line end to the pixel, so the bend was lumpy, as the usage chart's lines were (Usage: the subscription limits chart draws its dashed lines as cramped dots #445). At 1.4× the line down was blurred across two pixel columns.
  • Pictures 1loop draws itself (the usage chart's lines, now the tree): Fyne places them at fractional positions and smooths them, so a crisp line spreads over two rows of the screen.

What changes

  • Halo and shadows: each is now one picture drawn at the screen's resolution (soft_shadow.go), fading out like a blurred shape. A Gaussian edge, cached per size, takes about 2 ms for a large dialog. Near its edge a shadow is as dark as before; inside, it is unchanged.
  • The halo: now even all around and a little brighter, as asked. It is drawn over the shadow; at its top it measured about 20 instead of 18 (amber over the background).
  • The tree: drawn as one picture. Its straight parts sit on whole pixels and are crisp, and its bend is a smooth quarter circle. There is no seam where they meet; a test checks this and fails on the previous drawing.
  • The rasters 1loop draws: sized to whole pixels and drawn with nearest sampling, so one pixel of the picture is one pixel of the screen.
  • Frosted glass and translucency of dialogs and menus are untouched. Inside the panels, colours are identical to before, pixel for pixel (checked on Linux).

Tested

  • gofmt, go vet ./..., wasm vet, go test ./...; the UI tests ran 3 times.
  • Linux (Xvfb, at 1.4×, the scale of a 1803×1202 laptop screen) and Windows (VM, 1×): both builds captured before and after. Captured: focused composer, Search dialog, a menu, and a chat with 3 subchats.

Linux, 1.4×

Halo, before (left) and after (right):
Linux 1.4x, composer halo zoomed: before (left), after (right)

Linux 1.4x, composer after

Menu shadow corner, before and after:
Linux 1.4x, menu shadow corner zoomed: before (left), after (right)

Subchat tree, before and after:
Linux 1.4x, subchat tree zoomed: before (left), after (right)

Windows, 1×

Halo, before and after:
Windows 1x, composer halo zoomed: before (left), after (right)

Subchat tree, before and after:
Windows 1x, subchat tree zoomed: before (left), after (right)

Dialog shadow corner, before and after:
Windows 1x, dialog shadow corner zoomed: before (left), after (right)

Windows 1x, window after

Search dialog: the frosted backdrop is kept.
Windows 1x, Search dialog after: frosted backdrop kept

Not checked by eye: the subscription limits chart, because there is no limits data in the test profiles (its tests pass), and the light theme.

Assisted-by: Claude Opus 5.5 medium

🤖 Generated with Claude Code

tpm28 and others added 2 commits November 16, 2026 17:03
The composer's amber halo and the shadows of dialogs and menus were four
translucent rounded rectangles, each 3 px larger than the last, standing
in for a blur: their edges showed as steps, and the halo ended on a
visible line. Each is now one picture drawn at the screen's resolution,
fading out as a blurred shape does (a Gaussian edge), as dark as before
at the edge. The halo sits over the composer's shadow, which hid it on
the sides, so it is now even all around and a little brighter.

The subchat tree's bend was four short Fyne lines, each end rounded to
the pixel: lumpy, as the usage chart's lines were (#445). The guide is
now drawn as one picture: its straight parts on whole pixels, crisp, its
bend a smooth quarter circle. Rasters are sized to whole pixels and drawn
with nearest sampling: Fyne placed them at fractional positions and
smoothed them, spreading each crisp line over two rows; the usage
chart's strokes get the same treatment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Opus 5.5 medium
The bend was drawn 0.8 px wider than the straight parts so that it would
not look fainter: it overhung them where they meet, a dark speck at the
corner, and looked heavier than the rest. It is now exactly as wide, so
its edges carry on the line's, like the app's other rounded corners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Opus 5.5 medium
@tpm28
tpm28 marked this pull request as ready for review November 16, 2026 16:18
@tpm28
tpm28 requested a review from MopigamesYT November 16, 2026 16:18
@MopigamesYT

Copy link
Copy Markdown
Member

Heads-up from testing the open PRs merged together: this PR and #472 both change internal/ui/desktop.go, and they conflict there. Each merges cleanly onto dev on its own, so whichever merges second will need a rebase on dev.

This branch has not been deployed

No deployments
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.

2 participants