Spaces:
Running
Running
fix
Browse files- js/interactive_grid.js +5 -5
js/interactive_grid.js
CHANGED
|
@@ -222,13 +222,13 @@ function drawBackgroundBefore() {
|
|
| 222 |
|
| 223 |
const scale = Math.max(scaleX, scaleY);
|
| 224 |
|
| 225 |
-
const newWidth = bgWidth *
|
| 226 |
-
const newHeight = bgHeight *
|
| 227 |
|
| 228 |
const xOffset = (canvasWidth - newWidth) / 2;
|
| 229 |
const yOffset = (canvasHeight - newHeight) / 2;
|
| 230 |
|
| 231 |
-
ctx_bef.drawImage(canvasBg_bef, 0, 0, bgWidth, bgHeight,
|
| 232 |
}
|
| 233 |
}
|
| 234 |
|
|
@@ -245,8 +245,8 @@ function drawBackgroundAfter() {
|
|
| 245 |
|
| 246 |
const scale = Math.max(scaleX, scaleY);
|
| 247 |
|
| 248 |
-
const newWidth = bgWidth *
|
| 249 |
-
const newHeight = bgHeight *
|
| 250 |
|
| 251 |
const xOffset = (canvasWidth - newWidth) / 2;
|
| 252 |
const yOffset = (canvasHeight - newHeight) / 2;
|
|
|
|
| 222 |
|
| 223 |
const scale = Math.max(scaleX, scaleY);
|
| 224 |
|
| 225 |
+
const newWidth = bgWidth * scaleX;
|
| 226 |
+
const newHeight = bgHeight * scaleY;
|
| 227 |
|
| 228 |
const xOffset = (canvasWidth - newWidth) / 2;
|
| 229 |
const yOffset = (canvasHeight - newHeight) / 2;
|
| 230 |
|
| 231 |
+
ctx_bef.drawImage(canvasBg_bef, 0, 0, bgWidth, bgHeight, xOffset, yOffset, newWidth, newHeight);
|
| 232 |
}
|
| 233 |
}
|
| 234 |
|
|
|
|
| 245 |
|
| 246 |
const scale = Math.max(scaleX, scaleY);
|
| 247 |
|
| 248 |
+
const newWidth = bgWidth * scaleX;
|
| 249 |
+
const newHeight = bgHeight * scaleY;
|
| 250 |
|
| 251 |
const xOffset = (canvasWidth - newWidth) / 2;
|
| 252 |
const yOffset = (canvasHeight - newHeight) / 2;
|