Skip to content

Commit baa7dab

Browse files
better canvas size
1 parent 137672a commit baa7dab

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

CSS/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#settings {
77
display: block;
8-
width: 70%;
8+
width: 65%;
99
margin: auto;
1010
}
1111

JS/Start.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const fps = 30;//This is the maximum frames per second, lag can make the simulat
66
const roundingAccuaracy = 100;//This is the rounding on the temperatures shown above the tank
77
var particleMass = 5;//This changes the scaling on how fast the lab goes
88
var equilibriumFudging = 0.01;//This is the amount of error after rounding the program will accept as an equilibrium
9+
var canvasSize = 0.65;//Overall size of the canvas
910

1011
//left side
1112
var initTempLeft = 20;
@@ -34,7 +35,7 @@ var allowCrossOver = false;
3435
var ctx;
3536
var gameLoop;
3637
var mouse;
37-
var stopwatchTime;
38+
var stopwatchTime = 0;
3839
var isStopwatchRunning;
3940
var roundedTempLeft;
4041
var roundedTempRight;
@@ -163,16 +164,15 @@ function printInputs() {
163164

164165
function setStopwatch(){
165166
if(!allowCrossOver){
166-
stopwatchTime = 0;
167167
isStopwatchRunning = true;
168168
}else{
169169
isStopwatchRunning = false;
170170
}
171171
}
172172

173173
function refreshSize() {
174-
ctx.canvas.width = window.innerWidth*0.7;
175-
ctx.canvas.height = window.innerWidth*0.7 / canvasRatio;
174+
ctx.canvas.width = window.innerWidth*canvasSize;
175+
ctx.canvas.height = window.innerWidth*canvasSize / canvasRatio;
176176
$('#canvasContainer').css('width', ctx.canvas.width);
177177
$('#canvasContainer label').css('width', ctx.canvas.width/2.1);
178178
$('#canvasContainer label').css('display', 'inline-block');

0 commit comments

Comments
 (0)