Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

gui: let a recorded quad surface be replayed at an offset

RoversX76c41f342a1d
diff --git a/wezterm-gui/src/quad.rs b/wezterm-gui/src/quad.rs
index 1c16f8cf..5a202f09 100644
--- a/wezterm-gui/src/quad.rs
+++ b/wezterm-gui/src/quad.rs
@@ -840,11 +840,29 @@ impl HeapQuadAllocator {
other: &mut TripleLayerQuadAllocator,
clip: QuadClipRect,
opacity: f32,
+ ) -> anyhow::Result<()> {
+ self.apply_to_clipped_at(other, 0.0, 0.0, clip, opacity)
+ }
+
+ /// `apply_to_clipped`, shifted by `offset` on the way out.
+ ///
+ /// Lets a caller record a surface in its own local space — its left edge
+ /// at 0 — and place it on replay. That matters when the surface's real
+ /// origin is off-screen: the painters take unsigned pixel coordinates, so
+ /// a negative origin cannot be expressed at record time, and clamping it
+ /// to 0 lays the contents out from the wrong place.
+ pub fn apply_to_clipped_at(
+ &self,
+ other: &mut TripleLayerQuadAllocator,
+ offset_x: f32,
+ offset_y: f32,
+ clip: QuadClipRect,
+ opacity: f32,
) -> anyhow::Result<()> {
let started = std::time::Instant::now();
for (layer_num, quads) in self.layers() {
for quad in quads {
- let Some(clipped) = quad.translated_clipped(0.0, 0.0, clip) else {
+ let Some(clipped) = quad.translated_clipped(offset_x, offset_y, clip) else {
continue;
};
let clipped = if opacity < 1.0 {