Canvas stretch when resizing browser window

The canvas in my CSS is set with a fixed width and height, as shown in the picture.

However, whenever I resize the window, it forcefully resets the canvas width and height to match the entire browser window width and height, causing stretching.