diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-16 11:53:11 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | 71c273b7777ed17bc72c11df1a9221a9e645c714 (patch) | |
| tree | fd66e5fe95168f91e898fa587b625954b171e65e /src/macos/Sources | |
| parent | 051fa32a31fab2980b5e8af3113befc83d7914b3 (diff) | |
| download | pardes-71c273b7777ed17bc72c11df1a9221a9e645c714.tar.gz pardes-71c273b7777ed17bc72c11df1a9221a9e645c714.zip | |
Restore the macOS shell build after the compact tagline drift
The body-layer context rules landed on a private TaglineMetrics.scale, which
never compiled: no macOS host built this shell when they were written. Expose
the physical-pixel thickness the way borderThickness/borderTop already expose
theirs, and paint the rule over the row's last pixel the way the SDL shell
does, so the two shells agree on the pixel rather than sitting one apart.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Diffstat (limited to 'src/macos/Sources')
| -rw-r--r-- | src/macos/Sources/PardesView.swift | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/macos/Sources/PardesView.swift b/src/macos/Sources/PardesView.swift index f64678ee..cd3ec980 100644 --- a/src/macos/Sources/PardesView.swift +++ b/src/macos/Sources/PardesView.swift @@ -531,6 +531,12 @@ private struct TaglineMetrics { let px = pardes_topbar_pane_border_px(cellPixels, bandPixels) return (CGFloat(cellPixels * UInt32(PARDES_TOPBAR_H)) - CGFloat(px / 2)) / scale } + + /// One physical pixel, in points. The rules separating discontinuous + /// context rows inside a body layer are a single pixel in the SDL shell, + /// so they are stated there and converted here rather than handing `scale` + /// out and letting the caller reinvent the conversion. + var contextBorderThickness: CGFloat { 1 / scale } } private func modifiers(_ flags: NSEvent.ModifierFlags) -> UInt32 { @@ -1362,8 +1368,11 @@ final class PardesView: NSView { if border != UInt32(PARDES_COLOR_DEFAULT) { for row in 0..<contexts { if value(11 + row) == 0 { continue } - fill(ctx, CGRect(x: left, y: top + CGFloat(row + 1)*taglines.height, - width: viewport.width, height: 1/taglines.scale), border, 1) + // The SDL shell paints this rule over the row's LAST pixel, not + // the next row's first one; keep the two shells on the same pixel. + let thickness = taglines.contextBorderThickness + fill(ctx, CGRect(x: left, y: top + CGFloat(row + 1)*taglines.height - thickness, + width: viewport.width, height: thickness), border, 1) } } ctx.restoreGState() |
