diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/gui/gui.zig | 7 | ||||
| -rw-r--r-- | src/macos/Sources/PardesView.swift | 2 | ||||
| -rw-r--r-- | src/pardes.zig | 2 | ||||
| -rw-r--r-- | src/web/app.mjs | 2 |
4 files changed, 6 insertions, 7 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig index 10ac839e..590e5aa8 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -6568,7 +6568,7 @@ fn appendPaneChrome( fn appendTagGrips(g: *const Gui, surface: *const pardes.Surface, layout: CellLayout, builder: *OverlayBuilder) void { if (g.tagline_height < 6 or g.tagline_width < 3) return; for (surface.tagLayers()) |layer| { - if (layer.cols == 0 or layer.kind == .workspace or layer.viewport.x < config.GUTTER) continue; + if (layer.cols == 0 or layer.kind != .pane or layer.viewport.x < config.GUTTER) continue; const x = layer.viewport.x - config.GUTTER; const y = layer.viewport.y; if (x >= surface.cols or y >= surface.rows) continue; @@ -6586,7 +6586,7 @@ fn appendTagGrips(g: *const Gui, surface: *const pardes.Surface, layout: CellLay } } -test "column and pane grip marks share physical centering" { +test "column grips stay unmarked while pane marks retain physical centering" { var g: Gui = undefined; g.tagline_height = 12; g.tagline_width = 6; @@ -6598,8 +6598,7 @@ test "column and pane grip marks share physical centering" { var vertices: [24]OverlayVertex = undefined; var builder: OverlayBuilder = .{ .vertices = &vertices, .win_w = 200, .win_h = 80 }; appendTagGrips(&g, &surface, .{ .w = 10, .h = 20, .x_off = 0, .y_off = 0 }, &builder); - try std.testing.expectEqual(@as(usize, 24), builder.len); - for (0..12) |i| try std.testing.expectEqual(vertices[i].x, vertices[i + 12].x); + try std.testing.expectEqual(@as(usize, 12), builder.len); try std.testing.expectApproxEqAbs(@as(f32, 57.0 / 200.0 * 2.0 - 1.0), vertices[0].x, 0.0001); } diff --git a/src/macos/Sources/PardesView.swift b/src/macos/Sources/PardesView.swift index 4c122a13..ba05ea51 100644 --- a/src/macos/Sources/PardesView.swift +++ b/src/macos/Sources/PardesView.swift @@ -1173,7 +1173,7 @@ final class PardesView: NSView { private func drawTagGrip(_ ctx: CGContext, values: [Int], canonical: UnsafePointer<pardes_cell_s>, cols: Int, rows: Int) { let width = Int(pardes_grip_columns()) let x = values[4] - width, y = values[5] - if values[1] == 0 || x < 0 || x >= cols || y >= rows || taglines.height < 6 || taglines.width < 3 { return } + if values[1] != 2 || x < 0 || x >= cols || y >= rows || taglines.height < 6 || taglines.width < 3 { return } var cell = canonical[y * cols + x] let text = withUnsafeBytes(of: &cell.text) { String(decoding: $0.prefix(Int(cell.len)), as: UTF8.self) } if text != " " { return } diff --git a/src/pardes.zig b/src/pardes.zig index 91605d38..bd7c43e9 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -13262,7 +13262,7 @@ pub const Pardes = struct { const active_col = if (layout.findPane(p, p.active)) |f| f.col == c else false; const bg = if (active_col and p.settings.focus_tint) chrome.tag_active_bg else chrome.tag_bg; const fg = if (active_col and p.settings.focus_tint) chrome.tag_active_fg else chrome.tag_fg; - const grip_bg = if (active_col) chrome.column_box else chrome.column_box_dim; + const grip_bg = chrome.column_box_dim; const lum = (@as(u16, grip_bg[0]) * 3 + @as(u16, grip_bg[1]) * 6 + @as(u16, grip_bg[2])) / 10; const ink: [3]u8 = if (lum > 140) .{ 0, 0, 0 } else .{ 255, 255, 255 }; const grip_style: CellStyle = .{ .bg = .{ .rgb = grip_bg }, .fg = .{ .rgb = ink }, .font_role = .tagline }; diff --git a/src/web/app.mjs b/src/web/app.mjs index 3dcf6ab5..65e1240d 100644 --- a/src/web/app.mjs +++ b/src/web/app.mjs @@ -123,7 +123,7 @@ export class DomRenderer { const gripCols = this.wasm.pardes_grip_columns?.() ?? 2; const gripX = values[4] - gripCols; const gripCell = canonical[values[5]*this.cols+gripX]; - const grip = values[1] !== 0 && gripX >= 0 && gripCell?.text === " " && th >= 6 && tw >= 3; + const grip = values[1] === 2 && gripX >= 0 && gripCell?.text === " " && th >= 6 && tw >= 3; const geometry = [bw,bh,tw,th,offset,...values,grip,gripCell?.fg].join(":"); const cached = this.tagNodes.get(i); if (cached && cached.geometry === geometry && cached.bytes.length === bytes.length && cached.bytes.every((byte,index)=>byte===bytes[index])) { |
