Compare commits

...

5 Commits

Author SHA1 Message Date
Aakansha Doshi 5f8321cf62 fix 2023-09-05 20:33:36 +05:30
Aakansha Doshi dc6b0be87d fix 2023-09-05 20:29:10 +05:30
Aakansha Doshi 3b350ee904 ci: disable comment for bundle size check 2023-09-05 20:26:35 +05:30
David Luzar 27fd150a20 fix: canvas flickering due to resetting canvas on skipped frames (#6960) 2023-09-05 12:06:48 +02:00
zsviczian 188921c247 fix: grid jittery after partition PR (#6935) 2023-08-27 19:30:47 +02:00
3 changed files with 25 additions and 8 deletions
+4
View File
@@ -3,6 +3,10 @@ on:
pull_request:
branches:
- master
permissions:
pull-requests: read
jobs:
size:
runs-on: ubuntu-latest
+19 -4
View File
@@ -37,10 +37,25 @@ const StaticCanvas = (props: StaticCanvasProps) => {
canvas.classList.add("excalidraw__canvas", "static");
}
canvas.style.width = `${props.appState.width}px`;
canvas.style.height = `${props.appState.height}px`;
canvas.width = props.appState.width * props.scale;
canvas.height = props.appState.height * props.scale;
const widthString = `${props.appState.width}px`;
const heightString = `${props.appState.height}px`;
if (canvas.style.width !== widthString) {
canvas.style.width = widthString;
}
if (canvas.style.height !== heightString) {
canvas.style.height = heightString;
}
const scaledWidth = props.appState.width * props.scale;
const scaledHeight = props.appState.height * props.scale;
// setting width/height resets the canvas even if dimensions not changed,
// which would cause flicker when we skip frame (due to throttling)
if (canvas.width !== scaledWidth) {
canvas.width = scaledWidth;
}
if (canvas.height !== scaledHeight) {
canvas.height = scaledHeight;
}
renderStaticScene(
{
+2 -4
View File
@@ -934,10 +934,8 @@ const _renderStaticScene = ({
strokeGrid(
context,
appState.gridSize,
-Math.ceil(appState.zoom.value / appState.gridSize) * appState.gridSize +
(appState.scrollX % appState.gridSize),
-Math.ceil(appState.zoom.value / appState.gridSize) * appState.gridSize +
(appState.scrollY % appState.gridSize),
appState.scrollX,
appState.scrollY,
appState.zoom,
normalizedWidth / appState.zoom.value,
normalizedHeight / appState.zoom.value,