mirror of
https://github.com/fairyglade/ly.git
synced 2026-05-13 18:40:46 +00:00
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:
committed by
AnErrupTion
parent
b8ae126623
commit
b3830d5bb6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user