Skip to content

Commit

Permalink
Revert "fix union{} ambiguity (#527)"
Browse files Browse the repository at this point in the history
This reverts commit 1a153e3.
  • Loading branch information
johnnychen94 committed Dec 15, 2022
1 parent df7cc12 commit 9518578
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ docs/build/
docs/site/
.DS_Store
/docs/Manifest.toml
Manifest.toml
8 changes: 4 additions & 4 deletions src/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ end


function Base.show(io::IO, mime::MIME"image/svg+xml", cs::AbstractVector{T};
max_swatches::Integer=0) where {Union{} <: T <: Color}
max_swatches::Integer=0) where T <: Color
mat = Base.ReshapedArray(cs, (1, length(cs)), ())
show(io, mime, mat, max_swatches=max_swatches)
end

function Base.show(io::IO, mime::MIME"image/svg+xml",cs::AbstractVector{T};
max_swatches::Integer=0) where {Union{} <: T <: TransparentColor}
max_swatches::Integer=0) where T <: TransparentColor

# use random id to avoid id collision when the SVG is embedded inline
id = "pat_" * string(rand(UInt32), base=62)
Expand Down Expand Up @@ -97,7 +97,7 @@ end


function Base.show(io::IO, mime::MIME"image/svg+xml", cs::AbstractMatrix{T};
max_swatches::Integer=0) where {Union{} <: T <: Color}
max_swatches::Integer=0) where T <: Color
m, n = size(cs)
actual_max_swatches = max_swatches > 0 ? max_swatches : default_max_swatches
if m * n > actual_max_swatches
Expand Down Expand Up @@ -151,7 +151,7 @@ end


function show_strokes(io::IO, mime::MIME"image/svg+xml", cs::AbstractMatrix{T};
max_swatches::Integer=0) where {Union{} <: T <: Color}
max_swatches::Integer=0) where T <: Color
m, n = size(cs)
actual_max_swatches = max_swatches > 0 ? max_swatches : default_max_swatches
# When `max_swatches` is specified, the following warning is suppressed.
Expand Down

0 comments on commit 9518578

Please sign in to comment.