mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: freedraw jittering (#8238)
This commit is contained in:
parent
6fbc44fd1f
commit
df8875a497
1 changed files with 1 additions and 10 deletions
|
@ -471,16 +471,7 @@ const drawElementFromCanvas = (
|
||||||
const element = elementWithCanvas.element;
|
const element = elementWithCanvas.element;
|
||||||
const padding = getCanvasPadding(element);
|
const padding = getCanvasPadding(element);
|
||||||
const zoom = elementWithCanvas.scale;
|
const zoom = elementWithCanvas.scale;
|
||||||
let [x1, y1, x2, y2] = getElementAbsoluteCoords(element, allElementsMap);
|
const [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 cx = ((x1 + x2) / 2 + appState.scrollX) * window.devicePixelRatio;
|
const cx = ((x1 + x2) / 2 + appState.scrollX) * window.devicePixelRatio;
|
||||||
const cy = ((y1 + y2) / 2 + appState.scrollY) * window.devicePixelRatio;
|
const cy = ((y1 + y2) / 2 + appState.scrollY) * window.devicePixelRatio;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue