Skip to content

Commit

Permalink
Workaround occasional BoundsErrors. Fixes #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunetos committed May 23, 2014
1 parent 8cd4b86 commit eb909fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function plot(data::PlotInputs, start::Real=-10, stop::Real=10;
grid = fill(char(0x2800), cols, rows)
left, right = sides = ((0, 1, 2, 6), (3, 4, 5, 7))
function showdot(x, y) # Assumes x & y are already scaled to the grid.
invy = rows - y
invy = (rows - y)*0.9999
col, col2 = int(floor(x)), int(floor(x*2))
row, row4 = int(floor(invy)), int(floor(invy*4))
grid[col + 1, row + 1] |= 1 << sides[1 + (col2 & 1)][1 + (row4 & 3)]
Expand Down
1 change: 1 addition & 0 deletions test/plot.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# TODO: Make tests that vary the parameters and validate the output.

plot(sinpi, -2, 2)
plot(rand(15))
plot(rand(15, 4))

Expand Down

0 comments on commit eb909fc

Please sign in to comment.