Skip to content

Commit

Permalink
Merge pull request #3590 from t-bltg/warn
Browse files Browse the repository at this point in the history
GR: 3D, warn on invalid rotation or tilt
  • Loading branch information
t-bltg authored Jul 5, 2021
2 parents db7420f + 1ddc673 commit fbd5d79
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/backends/gr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down

0 comments on commit fbd5d79

Please sign in to comment.