-
-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use poly in axis background, test that no rasterization happens in ba…
…sic svgs (#1734) * use poly in axis background, test that no rasterization happens in basic svgs * add notice
- Loading branch information
1 parent
4827f7f
commit 68d69c4
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# guard against some future changes silently making simple vector graphics be | ||
# rasterized if they are using features unsupported by the SVG spec | ||
function svg_isnt_rasterized(x) | ||
mktempdir() do path | ||
path = joinpath(path, "test.svg") | ||
save(path, x) | ||
# this is rough but an easy way to catch rasterization, | ||
# if an image element is present in the svg | ||
return !occursin("<image id=", read(path, String)) | ||
end | ||
end | ||
|
||
@testset "SVG rasterization" begin | ||
@test svg_isnt_rasterized(Scene()) | ||
@test svg_isnt_rasterized(begin f = Figure(); Axis(f[1, 1]); f end) | ||
@test svg_isnt_rasterized(scatter(1:3)) | ||
@test svg_isnt_rasterized(lines(1:3)) | ||
@test svg_isnt_rasterized(heatmap(rand(5, 5))) | ||
@test !svg_isnt_rasterized(image(rand(5, 5))) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters