mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix: incorrectly rendering freedraw elements (#5481)
This commit is contained in:
parent
2b71a1f0bd
commit
ac66665b64
1 changed files with 6 additions and 6 deletions
|
@ -752,12 +752,6 @@ export const renderElement = (
|
|||
generateElementShape(element, generator);
|
||||
|
||||
if (renderConfig.isExporting) {
|
||||
const elementWithCanvas = generateElementWithCanvas(
|
||||
element,
|
||||
renderConfig,
|
||||
);
|
||||
drawElementFromCanvas(elementWithCanvas, rc, context, renderConfig);
|
||||
} else {
|
||||
const [x1, y1, x2, y2] = getElementAbsoluteCoords(element);
|
||||
const cx = (x1 + x2) / 2 + renderConfig.scrollX;
|
||||
const cy = (y1 + y2) / 2 + renderConfig.scrollY;
|
||||
|
@ -769,6 +763,12 @@ export const renderElement = (
|
|||
context.translate(-shiftX, -shiftY);
|
||||
drawElementOnCanvas(element, rc, context, renderConfig);
|
||||
context.restore();
|
||||
} else {
|
||||
const elementWithCanvas = generateElementWithCanvas(
|
||||
element,
|
||||
renderConfig,
|
||||
);
|
||||
drawElementFromCanvas(elementWithCanvas, rc, context, renderConfig);
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue