Skip to content

Commit

Permalink
fix bounds error for wglmakie closes #3961
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Dec 2, 2024
1 parent 068670b commit de329bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ffmpeg-util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ end

function next_tick!(controller::TickController)
controller.tick[] = Tick(
OneTimeRenderTick,
OneTimeRenderTick,
controller.frame_counter,
controller.frame_counter * controller.frame_time,
controller.frame_time
Expand Down Expand Up @@ -260,7 +260,12 @@ function VideoStream(fig::FigureLike;
get!(config, :visible, visible)
get!(config, :start_renderloop, false)
screen = getscreen(backend, scene, config, GLNative)
_xdim, _ydim = size(screen)
# Use colorbuffer to get the actual dimensions for the backend,
# since the backend might have a different size from the Monitor scaling.
# In case of WGLMakie, this isn't easy to find out otherwise,
# So for now we just use colorbuffer until we have a reliable pixel_size(screen) function.
first_frame = colorbuffer(screen)
_xdim, _ydim = size(first_frame)
xdim = iseven(_xdim) ? _xdim : _xdim + 1
ydim = iseven(_ydim) ? _ydim : _ydim + 1
buffer = Matrix{RGB{N0f8}}(undef, xdim, ydim)
Expand Down

0 comments on commit de329bf

Please sign in to comment.