summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()