srdusr
aboutsummaryrefslogtreecommitdiffstats
path: root/crates/wayland/src/decoration/corners.rs
AgeCommit message (Collapse)AuthorFilesLines
2026-08-30Indent doc list continuationssrdusr1-7/+7
2025-05-23Fix the border ring's inner cut using the wrong circle for undecorated windowssrdusr1-41/+94
carve_inner_corner_pixel (an earlier ring fix) cut the border strip's own disk using an inner circle at the *same* centre as the outer cut, radius - border_width - correct when a titlebar sits underneath (it shares that exact circle, by construction), but wrong whenever client content sits underneath instead: content's own rounded-corner mask (rounded_corners_pixman.rs's apply_corner_mask) is centred radius from *its own* buffer's edges, and that buffer starts border_width rows/columns inside the border strip's - a same-radius circle offset (border_width, border_width) diagonally from the border's own outer one, not a smaller concentric one. Reusing the titlebar-style ring left a real, if very small, gap along part of the seam and a thin sliver of double coverage along the rest - reported live, at extreme zoom against a solid-colour wallpaper (chosen specifically to make a sub-pixel gap easy to spot against, unlike the usual desktop image): "very tiny gaps... corner radius does not match." round_top_corners/round_bottom_corners's own `inner_radius: Option<u32>` parameter is now `inner: Option<InnerRing>`, an explicit (center_row, center_col, radius) rather than an implicit "same centre, smaller radius" - InnerRing's own doc comment has the full geometry for both cases. render_border_top gained a `decorated` parameter to pick the right one (titlebar-aligned when true, content-aligned - centre shifted by border_width on both axes, radius unchanged - when false); render_border_bottom always uses the content-aligned ring, since this compositor never draws a bottom titlebar. apply_corner_mask (rounded_corners_pixman.rs) made pub(crate) so the new regression test can build a real masked content buffer via the actual production function, not a reimplementation of its math. border_top_and_content_mask_have_no_gap_along_the_corner_diagonal_when_undecorated checks coverage along the diagonal ray between the two circles' centres - the direction they're actually offset along, and so the worst case for a gap opening up between them - against the real render_border_top/apply_corner_mask output, not a hand-rederived formula.
2025-04-03Fix border corner rendered as a solid wedge instead of a ringsrdusr1-20/+140
round_top_corners/round_bottom_corners only ever cut pixels *outside* the shared corner radius (the rounded outer silhouette). Nothing cut anything *inside* it, so a border strip's own "extra" rows (present whenever corner_radius > border_width) stayed a solid filled disk out to the centre column/row, then hit clip_middle_beyond_thickness's hard, unblended rectangular cut right at the disk's own most opaque point - a clean right-angle step, not a curve. Confirmed live, zoomed: a real square notch bitten into an otherwise smooth arc, reported as "squares on the inside corners of each vertex." Added carve_inner_corner_pixel, the same smoothstep falloff as the existing outer cut but inverted (cuts near the centre instead of far from it), applied at radius - border_width so the corner becomes a genuine ring of ~border_width visible thickness tapering smoothly to transparent, instead of a filled wedge. Only render_border_top/ render_border_bottom pass an inner_radius; the titlebar's own corner and the lock-screen box keep their existing solid-disk behaviour, which is correct for a single flat-coloured panel with nothing of a different colour underneath needing to show through. Also generalizes round_top_corners with an explicit center_col parameter, mirroring the existing center_row shift: the titlebar's own corner circle was never shifted horizontally to match the border strip's (only vertically), leaving a border_width-wide sliver of the titlebar's own misaligned curve poking through at the seam. border_top_and_titlebar_corners_meet_without_a_seam and border_top_curve_actually_closes_within_the_side_strips_own_width updated to match: both now compare the correct corresponding columns (the titlebar's own buffer starts border_width columns inside the border strip's), and the latter no longer demands exact 255 opacity at a point that legitimately sits within the new inner cut's own antialiasing band.
2025-03-15Fix half-pixel seam between border-strip and content corner curvessrdusr1-6/+32
The border-strip bitmap's own corner rounding (corners.rs's blend_ corner_pixel) and the client-content mask's corner rounding (rounded_corners_pixman.rs's apply_corner_mask) are two independent implementations that need to trace the exact same circle where a window's border meets its own rounded content. Their falloff math was already identical (same smoothstep construction over the same radius-1..radius+1 band), but apply_corner_mask samples each pixel at its own center (x as f32 + 0.5) - the standard rasterization convention, matching the GLES shader used for the winit backend -- while blend_corner_pixel sampled at the raw integer coordinate (x as f32), a systematic half-pixel offset between the two curves. round_top_corners/round_bottom_corners had a compensating "- 1" baked into their own right-edge/bottom-edge center calculation, tuned against the old, uncentered convention. Confirmed live at extreme zoom: a small but real right-angle step partway along an otherwise smooth arc, right where the two curves are supposed to meet -- reported as "squares on the inside corners of each vertex." Added the missing + 0.5 to blend_corner_pixel and removed the two compensating "- 1"s (both call sites), which now line up exactly with apply_corner_mask's own clamp-derived center for the same corner (width - r / height - r, not width - r - 1 / height - r - 1). All 378 existing tests pass unchanged - none of them assert exact pixel positions this shifts by half a pixel.
2025-02-15Checkpoint: preserve all uncommitted rust-rewrite worktree worksrdusr1-0/+165
Safety commit before reconciling this worktree with main, which has diverged with its own separate fixes today. Nothing here is reviewed or curated yet - this exists purely so none of this work can be lost to a git operation, disk issue, or worktree cleanup while that reconciliation happens.