Skip to content

Commit

Permalink
try to fix worldage probs in PNG preview()
Browse files Browse the repository at this point in the history
  • Loading branch information
cormullion committed Jan 4, 2018
1 parent 2fec472 commit d333473
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/src/simplegraphics.md
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ fontsize(8) # hide
sethue("black") # hide
translate(-350, 0) # hide
function mybarfunction(low::Point, high::Point, value; extremes=[0, 1])
function mybarfunction(low::Point, high::Point, value; extremes=[0, 1], barnumber=0, bartotal=0)
@layer begin
sethue(rescale(value, extremes[1], extremes[2], 0, 1), 0.0, 1.0)
circle(high, 8, :fill)
Expand All @@ -849,7 +849,7 @@ function mybarfunction(low::Point, high::Point, value; extremes=[0, 1])
end
end
function mylabelfunction(low::Point, high::Point, value; extremes=[0, 1])
function mylabelfunction(low::Point, high::Point, value; extremes=[0, 1], barnumber=0, bartotal=0)
@layer begin
translate(low)
rotate(-pi/2)
Expand Down
3 changes: 2 additions & 1 deletion src/Luxor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ function preview()
if candisplay && jupyter
Main.IJulia.clear_output(true)
if currentdrawing.surfacetype == :png
display("image/png", load(currentdrawing.filename))
# avoid world age errors
Base.invokelatest(display, "image/png", load(currentdrawing.filename))
elseif currentdrawing.surfacetype == :svg
open(currentdrawing.filename) do f
display("image/svg+xml", readstring(f))
Expand Down

0 comments on commit d333473

Please sign in to comment.