Skip to content

Commit

Permalink
Improve export picture file naming
Browse files Browse the repository at this point in the history
  • Loading branch information
SeryiBaran committed Sep 29, 2024
1 parent f286be6 commit 5c8ff2f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<head>
<meta charset="UTF-8">
<title>Display test picture generator</title>
<script src="./jquery-3.7.1.min.js"></script>
<script src="./bresenham.js"></script>
<link rel="stylesheet" href="css/main.css">
<script src="./js/jquery-3.7.1.min.js"></script>
<script src="./js/bresenham.js"></script>
<link rel="stylesheet" href="./css/main.css">
</head>
<body>

Expand Down Expand Up @@ -58,6 +58,6 @@ <h1>Display test picture generator</h1>
<p class="credits">Written by <a href="https://github.com/fknipp/test-picture-generator/">fknipp</a> and <a href="https://github.com/SeryiBaran/test-picture-generator/">SeryiBaran</a>.</p>
</footer>

<script src="js/main.js"></script>
<script src="./js/main.js"></script>
</body>
</html>
File renamed without changes.
File renamed without changes.
9 changes: 8 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,14 @@ $("#download").on("click", function() {
var canvas = $("canvas")[0];
var image = canvas.toDataURL("image/png");
this.href = image;
this.download = "fknipp_edited_" + canvas.width + "x" + canvas.height + ".png";
this.download =
"fknipp" +
(only_geometry_mode ? "_GEOM" : "") +
(disable_colors ? "_NC" : "") +
(use_bresenham_algorithms ? "_BRSALG" : "") +
(enable_antialiasing_disable_filter ? "_ENANDISFILTER" : "") +
`_${canvas.width}x${canvas.height}` +
".png";
});

$("#go_fullscreen").on("click", function() {
Expand Down

0 comments on commit 5c8ff2f

Please sign in to comment.