fix(dur): apply correct offset for animations bigger than the terminal (#966)

Animations bigger than the rendering area would have an alignment to the
top left instead of center.

## What are the changes about?

Fixes incorrect offset calculations for dur movies bigger than the screen.

## What existing issue does this resolve?
N/A

## Pre-requisites

- [x] I have tested & confirmed the changes work locally
- [x] I have run `zig fmt` throughout my changes

Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/966
Reviewed-by: AnErrupTion <anerruption+codeberg@disroot.org>
This commit is contained in:
Titanium Brain
2026-05-09 21:06:45 +02:00
committed by AnErrupTion
parent b8ae126623
commit b3830d5bb6
2 changed files with 16 additions and 41 deletions

View File

@@ -381,6 +381,12 @@ pub fn setCell(x: usize, y: usize, cell: Cell) void {
);
}
pub fn setCellBoundsChecked(self: *TerminalBuffer, x: isize, y: isize, cell: Cell) void {
if (0 <= x and x < self.width and 0 <= y and y < self.height) {
cell.put(@intCast(x), @intCast(y));
}
}
pub fn reclaim(self: TerminalBuffer) !void {
if (self.termios) |termios| {
// Take back control of the TTY