Skip to content

Commit

Permalink
Merge pull request #283 from cy6erskunk/add-another-manual-test
Browse files Browse the repository at this point in the history
Add test case from #75
  • Loading branch information
cy6erskunk authored Dec 25, 2020
2 parents 6132068 + cfaf446 commit c112c6c
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
97 changes: 97 additions & 0 deletions manual-tests/index-umd-png-errors.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<!DOCTYPE html>
<head>
<meta charset='utf-8'>
<title>manual tests</title>
<style>
iframe {
width: 610px;
height: 200px;
}
.wrapper {
border: 1px solid #3c3c3c;
width: 300px; height: 300px;
}
.wrapper.wrapper-tall {
height: 600px;
}
.wrapper.wrapper-large {
width: 600px;
height: 600px;
}


svg {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="wrapper">
<svg width="500" height="500" viewBox="0 0 500 500">
<rect width="500" height="500" fill="#c1a5a9"></rect>
<g transform="translate(250, 250)">
<circle fill="#f08cae" r="240"></circle>
<circle fill="#9a4c95" r="180"></circle>
<circle fill="#4d2d52" r="120"></circle>
<circle fill="#1d1a31" r="60"></circle>
</g>
</svg>
</div>
<button>
save PNG
</button>
<div class="wrapper wrapper-large">
<svg width="500" height="500" viewBox="0 0 500 500">
<rect width="500" height="500" fill="#c1a5a9"></rect>
<g transform="translate(250, 250)">
<circle fill="#f08cae" r="240"></circle>
<circle fill="#9a4c95" r="180"></circle>
<circle fill="#4d2d52" r="120"></circle>
<circle fill="#1d1a31" r="60"></circle>
</g>
</svg>
</div>
<button>
save PNG
</button>
<div class="wrapper wrapper-tall">
<svg width="500" height="500" viewBox="0 0 500 500">
<rect width="500" height="500" fill="#c1a5a9"></rect>
<g transform="translate(250, 250)">
<circle fill="#f08cae" r="240"></circle>
<circle fill="#9a4c95" r="180"></circle>
<circle fill="#4d2d52" r="120"></circle>
<circle fill="#1d1a31" r="60"></circle>
</g>
</svg>
</div>
<button>
save PNG
</button>
<script src="main.js"></script>
<script>
function savePNG1() {
downloadPng(document.querySelector("#test1 svg"), "my_svg", {
css: "internal"
});
}

function savePNG2() {
downloadPng(document.querySelector("#test2 svg"), "my_svg", {
css: "internal"
});
}

function savePNG3() {
downloadPng(document.querySelector("#test3 svg"), "my_svg", {
css: "internal"
});
}

document.querySelector("#test1 button").addEventListener("click", savePNG1);
document.querySelector("#test2 button").addEventListener("click", savePNG2);
document.querySelector("#test3 button").addEventListener("click", savePNG3);

</script>
</body>
1 change: 1 addition & 0 deletions manual-tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
<iframe src="index-umd.html"></iframe>
<iframe src="index-umd-no-viewbox.html"></iframe>
<iframe src="index-umd-throwing.html"></iframe>
<iframe src="index-umd-png-errors.html"></iframe>
</body>

1 comment on commit c112c6c

@vercel
Copy link

@vercel vercel bot commented on c112c6c Dec 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.