ITADN

scale! is inconsistently applied to campixel and background axis for LScene

#5547Openmoyner 创建于 2026-03-04
bug
M
moynercommented
- [Makie 0.24.8 / GLMakie 0.13.8] what version of Makie are you running? (`]st -m Makie`) - [Yes] can you reproduce the bug with a fresh environment ? (`]activate --temp; add Makie`) - [Tested on macOS and Windows 11] What platform + GPU are you on? - [GLMakie] Which backend are you using? (GLMakie, CairoMakie, WGLMakie, RPRMakie) - [] Please provide an minimal example of the failing code. If the problem is with the visualization, please provide a picture or video of it. There seems to be a couple of issues with the scaling for LScene. I could be doing this the wrong way, though, but I have some workflows where scaling is used and this popped up. Two examples: ## Scaling of background mesh ```Julia using GLMakie using GLMakie.GeometryBasics c = Cylinder(Point3f(-1, 0, 0), Point3f(0, 0, 1), 0.3f0) fig, ax, plt = mesh(c) ax2 = LScene(fig[1, 2]) mesh!(ax2, c) scale!(ax2.scene, 1.0, 1.0, 3.0) fig ``` <img width="578" height="399" alt="Image" src="https://github.com/user-attachments/assets/f6cef568-4a02-44b7-bf10-d0ea95f896e8" /> ## Campixel subscene ```Julia c = Cylinder(Point3f(-1, 0, 0), Point3f(0, 0, 1), 0.3f0) fig, ax1, plt = mesh(c) ax2 = LScene(fig[1, 2]) mesh!(ax2, c) for ax in [ax1, ax2] bgscene = Scene(ax.scene) campixel!(bgscene) w, h = size(bgscene) # get the size of the scene in pixels # this draws a line at the scene window boundary bg = [sin(i/w) + cos(j/h) for i in 1:w, j in 1:h] bg_plt = image!(bgscene, [0.5*i/w + (1.0 - (j/h)^1.5) for i in 1:w, j in 1:h], colormap = :viridis, colorrange = (minimum(bg), maximum(bg)) ) translate!(bg_plt, 0, 0, -10000) end # Every so slightly scale axis2 scale!(ax2.scene, 1.0, 1.0, 1.0001) fig ``` In this case, the background disappears whenever scaling is used. Re-drawing it after scaling does not seem to help. <img width="578" height="399" alt="Image" src="https://github.com/user-attachments/assets/28d1166f-02be-4405-a075-34bdf5dcc1d3" />
1 条评论