feat: pass scrollConstraints via props

This commit is contained in:
Arnošt Pleskot
2023-07-07 15:35:10 +02:00
parent 381ef93956
commit 19ba107041
8 changed files with 21 additions and 6 deletions
+2
View File
@@ -42,6 +42,7 @@ const ExcalidrawBase = (props: ExcalidrawProps) => {
onPointerDown,
onScrollChange,
children,
scrollConstraints,
} = props;
const canvasActions = props.UIOptions?.canvasActions;
@@ -115,6 +116,7 @@ const ExcalidrawBase = (props: ExcalidrawProps) => {
onLinkOpen={onLinkOpen}
onPointerDown={onPointerDown}
onScrollChange={onScrollChange}
scrollConstraints={scrollConstraints}
>
{children}
</App>
+8 -1
View File
@@ -64,7 +64,14 @@ export const exportToCanvas = ({
const { exportBackground, viewBackgroundColor } = restoredAppState;
return _exportToCanvas(
passElementsSafely(restoredElements),
{ ...restoredAppState, offsetTop: 0, offsetLeft: 0, width: 0, height: 0 },
{
...restoredAppState,
offsetTop: 0,
offsetLeft: 0,
width: 0,
height: 0,
scrollConstraints: null,
},
files || {},
{ exportBackground, exportPadding, viewBackgroundColor },
(width: number, height: number) => {