diff options
Diffstat (limited to 'src/macos/Sources/PardesView.swift')
| -rw-r--r-- | src/macos/Sources/PardesView.swift | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/macos/Sources/PardesView.swift b/src/macos/Sources/PardesView.swift index b14e1aa0..2d43cc38 100644 --- a/src/macos/Sources/PardesView.swift +++ b/src/macos/Sources/PardesView.swift @@ -1185,7 +1185,8 @@ final class PardesView: NSView { private func snapshotBodyLayers() -> [FrozenBodyLayer] { var result: [FrozenBodyLayer] = [] for index in 0..<pardes_body_layer_limit() { - let values = (0..<11).map { Int(pardes_body_layer_value(index, UInt32($0))) } + let count = 11 + Int(pardes_body_layer_value(index, 2)) + let values = (0..<count).map { Int(pardes_body_layer_value(index, UInt32($0))) } if values[0] == 0 { continue } if let cells = pardes_body_layer_cells(index) { result.append(FrozenBodyLayer(values:values, cells:Array(UnsafeBufferPointer(start:cells,count:values[0]*values[1])))) @@ -1196,7 +1197,8 @@ final class PardesView: NSView { private func drawBodyLayers(_ ctx: CGContext, hideCursor:Bool) { for index in 0..<pardes_body_layer_limit() { - let values = (0..<11).map { Int(pardes_body_layer_value(index, UInt32($0))) } + let count = 11 + Int(pardes_body_layer_value(index, 2)) + let values = (0..<count).map { Int(pardes_body_layer_value(index, UInt32($0))) } if values[0] == 0 { continue } if let cells = pardes_body_layer_cells(index) { drawBodyLayer(ctx, values:values, cells:cells, hideCursor:hideCursor) } } @@ -1256,8 +1258,11 @@ final class PardesView: NSView { } let border = pardes_topbar_pane_border_rgb() if border != UInt32(PARDES_COLOR_DEFAULT) { - fill(ctx, CGRect(x: left, y: top+CGFloat(contexts)*taglines.height, - width: viewport.width, height: 1/taglines.scale), border, 1) + 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) + } } ctx.restoreGState() } |
