Skip to content

Commit

Permalink
Pad auto-calculated height/width + always automatically expand canvas…
Browse files Browse the repository at this point in the history
… size

The padding is overdue -- it *can* work without the padding, but it
really helps to have some quiet (black) padding around all 4 edges of
the image.

Expanding the canvas to fill the window (rather than capping it to its
max size) helps on higher resolution (e.g. 4k) displays.
  • Loading branch information
sz3 committed Jun 23, 2024
1 parent dcef5b6 commit d9b5388
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions web/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ return {
{
// reset zoom
var canvas = document.getElementById('canvas');
var width = window.innerWidth;
var height = window.outerHeight;
var width = window.innerWidth - 12;
var height = window.outerHeight - 12;
Main.scaleCanvas(canvas, width, height);
Main.alignInvisibleClick(canvas);
},
Expand Down Expand Up @@ -91,10 +91,7 @@ return {
if (height < dim) {
dim = height;
}
console.log(dim);
if (dim > 1040) {
dim = 1040;
}
console.log(dim + "x" + dim);
canvas.style.width = dim + "px";
canvas.style.height = dim + "px";
},
Expand Down

0 comments on commit d9b5388

Please sign in to comment.