╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ ui.zig ───────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1640 errdefer out.deinit(); 1641 1642 if (art.getGrid()) |art_grid| { 1643 const anchor_x = switch (anchor) { 1644 .top_left => 0, 1645 .top_right => foreground.size.width -| art_grid.size.width, 1646 }; 1647 for (0..art_grid.size.height) |y| { 1648 for (0..art_grid.size.width) |x| { 1649 const src = art_grid.cells.items[try art_grid.cells.at(.{ y, x })]; 1650 if (src.rune == null) continue; 1651 const idx = out.cells.at(.{ y, anchor_x + x }) catch continue; 1652 const dst = &out.cells.items[idx]; 1653 // composite the dimmed art behind every cell so it shows 1654 // through the whole UI: a blank cell becomes the art, while a 1655 // cell with a glyph keeps the glyph but takes the dimmed art as 1656 // its background (replacing whatever background it had, which 1657 // would otherwise obscure the art). 1658 if (cellIsBlank(dst.*)) { 1659 dst.* = src; 1660 dst.style.fg = sgrSafe(dimColor(dst.style.fg)); 1661 dst.style.bg = sgrSafe(dimColor(dst.style.bg)); 1662 } else { 1663 dst.style.bg = sgrSafe(dimColor(src.style.bg orelse src.style.fg)); 1664 } 1665 } 1666 } 1667 } 1668 return out; 1669 } 1670 }; 1671