Merge pull request #3590 from t-bltg/warn

GR: 3D, warn on invalid rotation or tilt
This commit is contained in:
t-bltg 2021-07-05 15:01:53 +02:00 committed by GitHub
commit fbd5d79d49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1327,7 +1327,13 @@ function gr_draw_axes(sp, viewport_plotarea)
# set space
xmin, xmax, ymin, ymax = gr_xy_axislims(sp)
zmin, zmax = gr_z_axislims(sp)
GR.setspace(zmin, zmax, round.(Int, sp[:camera])...)
camera = round.(Int, sp[:camera])
warn_invalid(val) = if val < 0 || val > 90 @warn "camera: $(val)° ∉ [0°, 90°]" end
warn_invalid.(camera)
GR.setspace(zmin, zmax, camera...)
# fill the plot area
gr_set_fill(plot_color(sp[:background_color_inside]))