mirror of
https://codeberg.org/fairyglade/ly.git
synced 2026-08-09 15:19:13 +02:00
fix crash in start_pos calc
This commit is contained in:
parent
30f73117d7
commit
fb77f90e4a
1 changed files with 4 additions and 2 deletions
|
|
@ -318,9 +318,11 @@ fn calc_start_position(terminal_buffer: *TerminalBuffer, dur_movie: *DurFormat,
|
|||
const buf_width: u32 = @intCast(terminal_buffer.width);
|
||||
const buf_height: u32 = @intCast(terminal_buffer.height);
|
||||
|
||||
const movie_width: u32 = @intCast(dur_movie.columns.?);
|
||||
const movie_height: u32 = @intCast(dur_movie.lines.?);
|
||||
var movie_width: u32 = @intCast(dur_movie.columns.?);
|
||||
var movie_height: u32 = @intCast(dur_movie.lines.?);
|
||||
|
||||
if (movie_width > buf_width) movie_width = buf_width;
|
||||
if (movie_height > buf_height) movie_height = buf_height;
|
||||
|
||||
const start_pos: IVec2 = switch (offset_alignment) {
|
||||
DurOffsetAlignment.center => .{ center(buf_width) - center(movie_width), center(buf_height) - center(movie_height) },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue