@@ -216,8 +216,10 @@ function iplot(pd::PlotData2DTriangulated;
216216 # Create a mesh overlay by plotting a mesh both on top of and below the solution contours.
217217 wire_points = Makie. @lift (convert_PlotData2D_to_mesh_Points (getindex (pd,
218218 variable_names[$ (menu. selection)])))
219- wire_mesh_top = Makie. lines! (ax, wire_points, color = :white )
220- wire_mesh_bottom = Makie. lines! (ax, wire_points, color = :white )
219+ wire_mesh_top = Makie. lines! (ax, wire_points, color = :white ,
220+ visible = toggle_solution_mesh. active)
221+ wire_mesh_bottom = Makie. lines! (ax, wire_points, color = :white ,
222+ visible = toggle_solution_mesh. active)
221223 Makie. translate! (wire_mesh_top, 0 , 0 , 1e-3 )
222224 Makie. translate! (wire_mesh_bottom, 0 , 0 , - 1e-3 )
223225
@@ -232,7 +234,8 @@ function iplot(pd::PlotData2DTriangulated;
232234 [Makie. Point (point. data[1 : 2 ]. .. , z_offset) for point in wire_points]
233235 end
234236 flat_wire_points = Makie. @lift get_flat_points ($ wire_points, $ z_offset)
235- wire_mesh_flat = Makie. lines! (ax, flat_wire_points, color = :black )
237+ wire_mesh_flat = Makie. lines! (ax, flat_wire_points, color = :black ,
238+ visible = toggle_mesh. active)
236239
237240 # create a small variation in the extrema to avoid the Makie `range_step` cannot be zero error.
238241 # see https://github.com/MakieOrg/Makie.jl/issues/931 for more details.
@@ -250,11 +253,6 @@ function iplot(pd::PlotData2DTriangulated;
250253 Makie. Colorbar (fig[1 , 3 ], limits = Makie. @lift (scaled_extrema ($ solution_z)),
251254 colormap = colormap)
252255
253- # This syncs the toggle buttons to the mesh plots.
254- Makie. connect! (wire_mesh_top. visible, toggle_solution_mesh. active)
255- Makie. connect! (wire_mesh_bottom. visible, toggle_solution_mesh. active)
256- Makie. connect! (wire_mesh_flat. visible, toggle_mesh. active)
257-
258256 # On OSX, shift-command-4 for screenshots triggers a constant "up-zoom".
259257 # To avoid this, we remap up-zoom to the right shift button instead.
260258 Makie. cameracontrols (ax. scene). controls. up_key = Makie. Keyboard. right_shift
0 commit comments