Skip to content

Commit

Permalink
fix: freedraw jittering (excalidraw#8238)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueGreenMagick authored Jul 14, 2024
1 parent 6fbc44f commit df8875a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions packages/excalidraw/renderer/renderElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,16 +471,7 @@ const drawElementFromCanvas = (
const element = elementWithCanvas.element;
const padding = getCanvasPadding(element);
const zoom = elementWithCanvas.scale;
let [x1, y1, x2, y2] = getElementAbsoluteCoords(element, allElementsMap);

// Free draw elements will otherwise "shuffle" as the min x and y change
if (isFreeDrawElement(element)) {
x1 = Math.floor(x1);
x2 = Math.ceil(x2);
y1 = Math.floor(y1);
y2 = Math.ceil(y2);
}

const [x1, y1, x2, y2] = getElementAbsoluteCoords(element, allElementsMap);
const cx = ((x1 + x2) / 2 + appState.scrollX) * window.devicePixelRatio;
const cy = ((y1 + y2) / 2 + appState.scrollY) * window.devicePixelRatio;

Expand Down

0 comments on commit df8875a

Please sign in to comment.