Skip to content

Commit

Permalink
fix px_per_unit scaling while rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Dec 22, 2024
1 parent 2e0aabe commit 3bb2128
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion GLMakie/src/postprocessing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,10 @@ function to_screen_postprocessor(framebuffer, shader_cache, screen_fb_id = nothi
default_id = isnothing(screen_fb_id) ? 0 : screen_fb_id[]
# GLFW uses 0, Gtk uses a value that we have to probe at the beginning of rendering
glBindFramebuffer(GL_FRAMEBUFFER, default_id)
glViewport(0, 0, framebuffer_size(screen)...)
# This includes px_per_unit scaling. The final output does not, so it
# needs to be removed (also true for size(screen), size(framebuffer), ...)
w, h = framebuffer_size(screen) ./ screen.px_per_unit[]
glViewport(0, 0, w, h)
glClear(GL_COLOR_BUFFER_BIT)
GLAbstraction.render(pass) # copy postprocess
end
Expand Down

0 comments on commit 3bb2128

Please sign in to comment.