summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-16 11:53:11 -0300
committerGabriel Schneider <[email protected]>2026-09-16 11:53:42 -0300
commit9375aec07534c24458f493aa355863ae73d16d4f (patch)
treefd66e5fe95168f91e898fa587b625954b171e65e /src
parent1f126bc0c8f2924c0c90f237c1cdfef5eea39cd8 (diff)
downloadpardes-9375aec07534c24458f493aa355863ae73d16d4f.tar.gz
pardes-9375aec07534c24458f493aa355863ae73d16d4f.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')
-rw-r--r--src/macos/Sources/PardesView.swift13
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()