Skip to content

Commit

Permalink
fix bounds error for wglmakie closes #3961 (#4639)
Browse files Browse the repository at this point in the history
* fix bounds error for wglmakie closes #3961

* size is actually reversed

* add changelog
  • Loading branch information
SimonDanisch authored Dec 3, 2024
1 parent 32f426c commit 5a35d5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Fix color mapping between contourf and colorbar [#4618](https://github.com/MakieOrg/Makie.jl/pull/4618)
- Fixed an incorrect comparison in CairoMakie's line clipping code causing a line segment to disappear [#4631](https://github.com/MakieOrg/Makie.jl/pull/4631)
- Fixed heatmap cells being 0.5px/units too large in CairoMakie [4633](https://github.com/MakieOrg/Makie.jl/pull/4633)
- Fix bounds error when recording video with WGLMakie [#4639](https://github.com/MakieOrg/Makie.jl/pull/4639).

## [0.21.16] - 2024-11-06

Expand Down
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)
_ydim, _xdim = 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 5a35d5e

Please sign in to comment.