So my rectangle i want to draw on a canvas are, i think scaled to the size of the canvas. I i want them to be 8x8 they dont come out as 8x8.
Here's my code:
function draw() {
var canvas = document.getElementById('karte');
var ctx = canvas.getContext("2d");
Stuttgart = ctx.fillRect(10,10,8,8);
}
.map {
height: 799px;
width: 591px;
margin: auto;
margin-top: 50px;
background-image: url('../img/Karte_Deutschland.svg');
background-repeat: no-repeat;
background-size: contain;
background-position: center;
}
.map canvas {
height: 799px;
width: 591px;
}
<canvas id="karte">
</canvas>
Here's a screenshot how it looks like in the end: https://prnt.sc/r58bvl