╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ ui.zig ───────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1212 1213 if (art.getGrid()) |art_grid| { 1214 const anchor_x = switch (anchor) { 1215 .top_left => 0, 1216 .top_right => foreground.size.width -| art_grid.size.width, 1217 }; 1218 for (0..art_grid.size.height) |y| { 1219 for (0..art_grid.size.width) |x| { 1220 const src = art_grid.cells.items[try art_grid.cells.at(.{ y, x })]; 1221 if (src.rune == null) continue; 1222 const idx = out.cells.at(.{ y, anchor_x + x }) catch continue; 1223 const dst = &out.cells.items[idx]; 1224 if (cellIsBlank(dst.*)) { 1225 dst.* = src; 1226 dst.style.fg = sgrSafe(dst.style.fg); 1227 dst.style.bg = sgrSafe(dst.style.bg); 1228 } else if (dst.style.bg == null) { 1229 dst.style.bg = sgrSafe(dimColor(artCellColor(src.style))); 1230 if (dst.style.fg == null) dst.style.fg = glyph_fg_over_art; 1231 } 1232 } 1233 } 1234 } 1235 return out; 1236 } 1237 }; 1238