From 3bb2128e8e106ba6706fa2ccf9ccb0802559016a Mon Sep 17 00:00:00 2001 From: ffreyer Date: Sun, 22 Dec 2024 19:28:30 +0100 Subject: [PATCH] fix px_per_unit scaling while rendering --- GLMakie/src/postprocessing.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GLMakie/src/postprocessing.jl b/GLMakie/src/postprocessing.jl index 0195b040ae3..1805aa63e17 100644 --- a/GLMakie/src/postprocessing.jl +++ b/GLMakie/src/postprocessing.jl @@ -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