mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-14 12:29:30 -07:00
Fixing the resize logic
This commit is contained in:
@@ -115,8 +115,8 @@ export default async (canvas, config) => {
|
||||
}
|
||||
|
||||
const devicePixelRatio = window.devicePixelRatio ?? 1;
|
||||
const canvasWidth = canvas.clientWidth * devicePixelRatio;
|
||||
const canvasHeight = canvas.clientHeight * devicePixelRatio;
|
||||
const canvasWidth = Math.ceil(canvas.clientWidth * devicePixelRatio * config.resolution);
|
||||
const canvasHeight = Math.ceil(canvas.clientHeight * devicePixelRatio * config.resolution);
|
||||
const canvasSize = [canvasWidth, canvasHeight];
|
||||
if (canvas.width !== canvasWidth || canvas.height !== canvasHeight) {
|
||||
canvas.width = canvasWidth;
|
||||
|
||||
Reference in New Issue
Block a user