diff options
| author | Ingmar Steen <iksteen@gmail.com> | 2026-09-06 19:59:13 +0200 |
|---|---|---|
| committer | Ingmar Steen <iksteen@gmail.com> | 2026-09-06 19:59:13 +0200 |
| commit | af82aff3cac5370cc08b2e0d7358097bfb2d9e45 (patch) | |
| tree | f13ad9272e021d039a462a96ce49f9c6b1929d68 /src/png.c | |
| parent | graphics: state z=0 on a placement, so a mirror paints it over the text (diff) | |
| download | slosh-af82aff3cac5370cc08b2e0d7358097bfb2d9e45.tar.gz slosh-af82aff3cac5370cc08b2e0d7358097bfb2d9e45.tar.xz slosh-af82aff3cac5370cc08b2e0d7358097bfb2d9e45.zip | |
graphics: place what a float leaves of an image, not nothing
Occlusion for placements is clipping: the cell compositor gets it free
from paint order, but images are sent after the diff and drawn over it,
so what a float covers has to be taken out of the placement itself. A
clean edge came out as a smaller rectangle; anything else -- a float
across the middle, a float on a corner, a float wholly inside -- was
refused, on the grounds that the remainder is an L and a placement is a
rectangle. The image vanished, all of it, the moment a floating pane
crossed it, on the terminal and in the mirror alike, and came back when
the float moved off.
The remainder is not one rectangle, but it is always a few: the strips
above and below what is covered, and what is left beside it between
them. So rect_subtract() cuts the visible remainder into rectangles and
each is placed in its own right, with the source rectangle the same
arithmetic the pane edge already used -- generalised to a cut on any
side, and to a first piece that keeps the sub-cell offset while the
others start on a cell boundary. Eight pieces is the ceiling (two
floats' worth); past it the old refusal stands.
The pieces of one placement need an id each, and the program's own
placement id is one number that cannot be several, so the model now
hands out the placement ids the client is told and keeps the program's
as the identity it was. `graphics` reports the piece alongside it.
Checked against a float parked over an image: the picture is cut around
the float, the strips tile exactly the image minus what the float
covers, and their source rectangles land where their cells do (a float
inside a 40x10-cell natural-size image gives 320x32 above, 320x32
below, 56x96 left and 72x96 right).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CRz3zwZJvBvzsR9k4cj6dd
Diffstat (limited to 'src/png.c')
0 files changed, 0 insertions, 0 deletions
