allow to supply canvas offsets from upstream (#2271)
This commit is contained in:
parent
499a60309f
commit
72a3450c99
@ -294,14 +294,14 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
||||
super(props);
|
||||
const defaultAppState = getDefaultAppState();
|
||||
|
||||
const { width, height, user, forwardedRef } = props;
|
||||
const { width, height, offsetLeft, offsetTop, user, forwardedRef } = props;
|
||||
this.state = {
|
||||
...defaultAppState,
|
||||
isLoading: true,
|
||||
width,
|
||||
height,
|
||||
username: user?.name || "",
|
||||
...this.getCanvasOffsets(),
|
||||
...this.getCanvasOffsets({ offsetLeft, offsetTop }),
|
||||
};
|
||||
if (forwardedRef && "current" in forwardedRef) {
|
||||
forwardedRef.current = {
|
||||
@ -702,9 +702,18 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
||||
this.scene.addCallback(this.onSceneUpdated);
|
||||
|
||||
this.addEventListeners();
|
||||
this.setState(this.getCanvasOffsets(), () => {
|
||||
|
||||
// optim to avoid extra render on init
|
||||
if (
|
||||
typeof this.props.offsetLeft === "number" &&
|
||||
typeof this.props.offsetTop === "number"
|
||||
) {
|
||||
this.initializeScene();
|
||||
});
|
||||
} else {
|
||||
this.setState(this.getCanvasOffsets(this.props), () => {
|
||||
this.initializeScene();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
@ -838,13 +847,18 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
||||
}, SYNC_FULL_SCENE_INTERVAL_MS);
|
||||
|
||||
componentDidUpdate(prevProps: ExcalidrawProps, prevState: AppState) {
|
||||
const { width: prevWidth, height: prevHeight } = prevProps;
|
||||
const { width: currentWidth, height: currentHeight, onChange } = this.props;
|
||||
if (prevWidth !== currentWidth || prevHeight !== currentHeight) {
|
||||
if (
|
||||
prevProps.width !== this.props.width ||
|
||||
prevProps.height !== this.props.height ||
|
||||
(typeof this.props.offsetLeft === "number" &&
|
||||
prevProps.offsetLeft !== this.props.offsetLeft) ||
|
||||
(typeof this.props.offsetTop === "number" &&
|
||||
prevProps.offsetTop !== this.props.offsetTop)
|
||||
) {
|
||||
this.setState({
|
||||
width: currentWidth,
|
||||
height: currentHeight,
|
||||
...this.getCanvasOffsets(),
|
||||
width: this.props.width,
|
||||
height: this.props.height,
|
||||
...this.getCanvasOffsets(this.props),
|
||||
});
|
||||
}
|
||||
|
||||
@ -966,8 +980,8 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
||||
|
||||
history.record(this.state, this.scene.getElementsIncludingDeleted());
|
||||
|
||||
if (onChange) {
|
||||
onChange(this.scene.getElementsIncludingDeleted(), this.state);
|
||||
if (this.props.onChange) {
|
||||
this.props.onChange(this.scene.getElementsIncludingDeleted(), this.state);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3964,18 +3978,33 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
||||
this.setState({ shouldCacheIgnoreZoom: false });
|
||||
}, 300);
|
||||
|
||||
private getCanvasOffsets(): Pick<AppState, "offsetTop" | "offsetLeft"> {
|
||||
private getCanvasOffsets(offsets?: {
|
||||
offsetLeft?: number;
|
||||
offsetTop?: number;
|
||||
}): Pick<AppState, "offsetTop" | "offsetLeft"> {
|
||||
if (
|
||||
typeof offsets?.offsetLeft === "number" &&
|
||||
typeof offsets?.offsetTop === "number"
|
||||
) {
|
||||
return {
|
||||
offsetLeft: offsets.offsetLeft,
|
||||
offsetTop: offsets.offsetTop,
|
||||
};
|
||||
}
|
||||
if (this.excalidrawRef?.current) {
|
||||
const parentElement = this.excalidrawRef.current.parentElement;
|
||||
const { left, top } = parentElement.getBoundingClientRect();
|
||||
return {
|
||||
offsetLeft: left,
|
||||
offsetTop: top,
|
||||
offsetLeft:
|
||||
typeof offsets?.offsetLeft === "number" ? offsets.offsetLeft : left,
|
||||
offsetTop:
|
||||
typeof offsets?.offsetTop === "number" ? offsets.offsetTop : top,
|
||||
};
|
||||
}
|
||||
return {
|
||||
offsetLeft: 0,
|
||||
offsetTop: 0,
|
||||
offsetLeft:
|
||||
typeof offsets?.offsetLeft === "number" ? offsets.offsetLeft : 0,
|
||||
offsetTop: typeof offsets?.offsetTop === "number" ? offsets.offsetTop : 0,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,8 @@ const Excalidraw = (props: ExcalidrawProps) => {
|
||||
const {
|
||||
width,
|
||||
height,
|
||||
offsetLeft,
|
||||
offsetTop,
|
||||
onChange,
|
||||
initialData,
|
||||
user,
|
||||
@ -44,6 +46,8 @@ const Excalidraw = (props: ExcalidrawProps) => {
|
||||
<App
|
||||
width={width}
|
||||
height={height}
|
||||
offsetLeft={offsetLeft}
|
||||
offsetTop={offsetTop}
|
||||
onChange={onChange}
|
||||
initialData={initialData}
|
||||
user={user}
|
||||
|
@ -150,6 +150,8 @@ function ExcalidrawApp() {
|
||||
<Excalidraw
|
||||
width={dimensions.width}
|
||||
height={dimensions.height}
|
||||
offsetLeft={0}
|
||||
offsetTop={0}
|
||||
onChange={saveDebounced}
|
||||
initialData={initialState.data}
|
||||
user={initialState.user}
|
||||
|
@ -446,7 +446,7 @@ Object {
|
||||
|
||||
exports[`given element A and group of elements B and given both are selected when user clicks on B, on pointer up only elements from B should be selected: [end of test] number of elements 1`] = `3`;
|
||||
|
||||
exports[`given element A and group of elements B and given both are selected when user clicks on B, on pointer up only elements from B should be selected: [end of test] number of renders 1`] = `26`;
|
||||
exports[`given element A and group of elements B and given both are selected when user clicks on B, on pointer up only elements from B should be selected: [end of test] number of renders 1`] = `25`;
|
||||
|
||||
exports[`given element A and group of elements B and given both are selected when user shift-clicks on B, on pointer up only element A should be selected: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -900,7 +900,7 @@ Object {
|
||||
|
||||
exports[`given element A and group of elements B and given both are selected when user shift-clicks on B, on pointer up only element A should be selected: [end of test] number of elements 1`] = `3`;
|
||||
|
||||
exports[`given element A and group of elements B and given both are selected when user shift-clicks on B, on pointer up only element A should be selected: [end of test] number of renders 1`] = `22`;
|
||||
exports[`given element A and group of elements B and given both are selected when user shift-clicks on B, on pointer up only element A should be selected: [end of test] number of renders 1`] = `21`;
|
||||
|
||||
exports[`regression tests Cmd/Ctrl-click exclusively select element under pointer: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -1663,7 +1663,7 @@ Object {
|
||||
|
||||
exports[`regression tests Cmd/Ctrl-click exclusively select element under pointer: [end of test] number of elements 1`] = `3`;
|
||||
|
||||
exports[`regression tests Cmd/Ctrl-click exclusively select element under pointer: [end of test] number of renders 1`] = `41`;
|
||||
exports[`regression tests Cmd/Ctrl-click exclusively select element under pointer: [end of test] number of renders 1`] = `40`;
|
||||
|
||||
exports[`regression tests Drags selected element when hitting only bounding box and keeps element selected: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -1854,7 +1854,7 @@ Object {
|
||||
|
||||
exports[`regression tests Drags selected element when hitting only bounding box and keeps element selected: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests Drags selected element when hitting only bounding box and keeps element selected: [end of test] number of renders 1`] = `10`;
|
||||
exports[`regression tests Drags selected element when hitting only bounding box and keeps element selected: [end of test] number of renders 1`] = `9`;
|
||||
|
||||
exports[`regression tests adjusts z order when grouping: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -2299,7 +2299,7 @@ Object {
|
||||
|
||||
exports[`regression tests adjusts z order when grouping: [end of test] number of elements 1`] = `3`;
|
||||
|
||||
exports[`regression tests adjusts z order when grouping: [end of test] number of renders 1`] = `20`;
|
||||
exports[`regression tests adjusts z order when grouping: [end of test] number of renders 1`] = `19`;
|
||||
|
||||
exports[`regression tests alt-drag duplicates an element: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -2539,7 +2539,7 @@ Object {
|
||||
|
||||
exports[`regression tests alt-drag duplicates an element: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests alt-drag duplicates an element: [end of test] number of renders 1`] = `10`;
|
||||
exports[`regression tests alt-drag duplicates an element: [end of test] number of renders 1`] = `9`;
|
||||
|
||||
exports[`regression tests arrow keys: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -2690,7 +2690,7 @@ Object {
|
||||
|
||||
exports[`regression tests arrow keys: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests arrow keys: [end of test] number of renders 1`] = `19`;
|
||||
exports[`regression tests arrow keys: [end of test] number of renders 1`] = `18`;
|
||||
|
||||
exports[`regression tests can drag element that covers another element, while another elem is selected: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -3154,7 +3154,7 @@ Object {
|
||||
|
||||
exports[`regression tests can drag element that covers another element, while another elem is selected: [end of test] number of elements 1`] = `3`;
|
||||
|
||||
exports[`regression tests can drag element that covers another element, while another elem is selected: [end of test] number of renders 1`] = `18`;
|
||||
exports[`regression tests can drag element that covers another element, while another elem is selected: [end of test] number of renders 1`] = `17`;
|
||||
|
||||
exports[`regression tests change the properties of a shape: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -3449,7 +3449,7 @@ Object {
|
||||
|
||||
exports[`regression tests change the properties of a shape: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests change the properties of a shape: [end of test] number of renders 1`] = `11`;
|
||||
exports[`regression tests change the properties of a shape: [end of test] number of renders 1`] = `10`;
|
||||
|
||||
exports[`regression tests click on an element and drag it: [dragged] appState 1`] = `
|
||||
Object {
|
||||
@ -3640,7 +3640,7 @@ Object {
|
||||
|
||||
exports[`regression tests click on an element and drag it: [dragged] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests click on an element and drag it: [dragged] number of renders 1`] = `10`;
|
||||
exports[`regression tests click on an element and drag it: [dragged] number of renders 1`] = `9`;
|
||||
|
||||
exports[`regression tests click on an element and drag it: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -3871,7 +3871,7 @@ Object {
|
||||
|
||||
exports[`regression tests click on an element and drag it: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests click on an element and drag it: [end of test] number of renders 1`] = `13`;
|
||||
exports[`regression tests click on an element and drag it: [end of test] number of renders 1`] = `12`;
|
||||
|
||||
exports[`regression tests click to select a shape: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -4110,7 +4110,7 @@ Object {
|
||||
|
||||
exports[`regression tests click to select a shape: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests click to select a shape: [end of test] number of renders 1`] = `13`;
|
||||
exports[`regression tests click to select a shape: [end of test] number of renders 1`] = `12`;
|
||||
|
||||
exports[`regression tests click-drag to select a group: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -4458,7 +4458,7 @@ Object {
|
||||
|
||||
exports[`regression tests click-drag to select a group: [end of test] number of elements 1`] = `3`;
|
||||
|
||||
exports[`regression tests click-drag to select a group: [end of test] number of renders 1`] = `19`;
|
||||
exports[`regression tests click-drag to select a group: [end of test] number of renders 1`] = `18`;
|
||||
|
||||
exports[`regression tests deselects group of selected elements on pointer down when pointer doesn't hit any element: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -4740,7 +4740,7 @@ Object {
|
||||
|
||||
exports[`regression tests deselects group of selected elements on pointer down when pointer doesn't hit any element: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests deselects group of selected elements on pointer down when pointer doesn't hit any element: [end of test] number of renders 1`] = `14`;
|
||||
exports[`regression tests deselects group of selected elements on pointer down when pointer doesn't hit any element: [end of test] number of renders 1`] = `13`;
|
||||
|
||||
exports[`regression tests deselects group of selected elements on pointer up when pointer hits common bounding box without hitting any element: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -5034,7 +5034,7 @@ Object {
|
||||
|
||||
exports[`regression tests deselects group of selected elements on pointer up when pointer hits common bounding box without hitting any element: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests deselects group of selected elements on pointer up when pointer hits common bounding box without hitting any element: [end of test] number of renders 1`] = `15`;
|
||||
exports[`regression tests deselects group of selected elements on pointer up when pointer hits common bounding box without hitting any element: [end of test] number of renders 1`] = `14`;
|
||||
|
||||
exports[`regression tests deselects selected element on pointer down when pointer doesn't hit any element: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -5229,7 +5229,7 @@ Object {
|
||||
|
||||
exports[`regression tests deselects selected element on pointer down when pointer doesn't hit any element: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests deselects selected element on pointer down when pointer doesn't hit any element: [end of test] number of renders 1`] = `8`;
|
||||
exports[`regression tests deselects selected element on pointer down when pointer doesn't hit any element: [end of test] number of renders 1`] = `7`;
|
||||
|
||||
exports[`regression tests deselects selected element, on pointer up, when click hits element bounding box but doesn't hit the element: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -5402,7 +5402,7 @@ Object {
|
||||
|
||||
exports[`regression tests deselects selected element, on pointer up, when click hits element bounding box but doesn't hit the element: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests deselects selected element, on pointer up, when click hits element bounding box but doesn't hit the element: [end of test] number of renders 1`] = `9`;
|
||||
exports[`regression tests deselects selected element, on pointer up, when click hits element bounding box but doesn't hit the element: [end of test] number of renders 1`] = `8`;
|
||||
|
||||
exports[`regression tests double click to edit a group: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -5842,7 +5842,7 @@ Object {
|
||||
|
||||
exports[`regression tests double click to edit a group: [end of test] number of elements 1`] = `3`;
|
||||
|
||||
exports[`regression tests double click to edit a group: [end of test] number of renders 1`] = `18`;
|
||||
exports[`regression tests double click to edit a group: [end of test] number of renders 1`] = `17`;
|
||||
|
||||
exports[`regression tests drags selected elements from point inside common bounding box that doesn't hit any element and keeps elements selected after dragging: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -6147,7 +6147,7 @@ Object {
|
||||
|
||||
exports[`regression tests drags selected elements from point inside common bounding box that doesn't hit any element and keeps elements selected after dragging: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests drags selected elements from point inside common bounding box that doesn't hit any element and keeps elements selected after dragging: [end of test] number of renders 1`] = `16`;
|
||||
exports[`regression tests drags selected elements from point inside common bounding box that doesn't hit any element and keeps elements selected after dragging: [end of test] number of renders 1`] = `15`;
|
||||
|
||||
exports[`regression tests draw every type of shape: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -8114,7 +8114,7 @@ Object {
|
||||
|
||||
exports[`regression tests draw every type of shape: [end of test] number of elements 1`] = `8`;
|
||||
|
||||
exports[`regression tests draw every type of shape: [end of test] number of renders 1`] = `51`;
|
||||
exports[`regression tests draw every type of shape: [end of test] number of renders 1`] = `50`;
|
||||
|
||||
exports[`regression tests given a group of selected elements with an element that is not selected inside the group common bounding box when element that is not selected is clicked should switch selection to not selected element on pointer up: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -8463,7 +8463,7 @@ Object {
|
||||
|
||||
exports[`regression tests given a group of selected elements with an element that is not selected inside the group common bounding box when element that is not selected is clicked should switch selection to not selected element on pointer up: [end of test] number of elements 1`] = `3`;
|
||||
|
||||
exports[`regression tests given a group of selected elements with an element that is not selected inside the group common bounding box when element that is not selected is clicked should switch selection to not selected element on pointer up: [end of test] number of renders 1`] = `19`;
|
||||
exports[`regression tests given a group of selected elements with an element that is not selected inside the group common bounding box when element that is not selected is clicked should switch selection to not selected element on pointer up: [end of test] number of renders 1`] = `18`;
|
||||
|
||||
exports[`regression tests given a selected element A and a not selected element B with higher z-index than A and given B partialy overlaps A when there's a shift-click on the overlapped section B is added to the selection: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -8705,7 +8705,7 @@ Object {
|
||||
|
||||
exports[`regression tests given a selected element A and a not selected element B with higher z-index than A and given B partialy overlaps A when there's a shift-click on the overlapped section B is added to the selection: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests given a selected element A and a not selected element B with higher z-index than A and given B partialy overlaps A when there's a shift-click on the overlapped section B is added to the selection: [end of test] number of renders 1`] = `17`;
|
||||
exports[`regression tests given a selected element A and a not selected element B with higher z-index than A and given B partialy overlaps A when there's a shift-click on the overlapped section B is added to the selection: [end of test] number of renders 1`] = `16`;
|
||||
|
||||
exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when clicking intersection between A and B B should be selected on pointer up: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -8945,7 +8945,7 @@ Object {
|
||||
|
||||
exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when clicking intersection between A and B B should be selected on pointer up: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when clicking intersection between A and B B should be selected on pointer up: [end of test] number of renders 1`] = `17`;
|
||||
exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when clicking intersection between A and B B should be selected on pointer up: [end of test] number of renders 1`] = `16`;
|
||||
|
||||
exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when dragging on intersection between A and B A should be dragged and keep being selected: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -9247,7 +9247,7 @@ Object {
|
||||
|
||||
exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when dragging on intersection between A and B A should be dragged and keep being selected: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when dragging on intersection between A and B A should be dragged and keep being selected: [end of test] number of renders 1`] = `18`;
|
||||
exports[`regression tests given selected element A with lower z-index than unselected element B and given B is partially over A when dragging on intersection between A and B A should be dragged and keep being selected: [end of test] number of renders 1`] = `17`;
|
||||
|
||||
exports[`regression tests hotkey 2 selects rectangle tool: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -9398,7 +9398,7 @@ Object {
|
||||
|
||||
exports[`regression tests hotkey 2 selects rectangle tool: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests hotkey 2 selects rectangle tool: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests hotkey 2 selects rectangle tool: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests hotkey 3 selects diamond tool: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -9549,7 +9549,7 @@ Object {
|
||||
|
||||
exports[`regression tests hotkey 3 selects diamond tool: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests hotkey 3 selects diamond tool: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests hotkey 3 selects diamond tool: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests hotkey 4 selects ellipse tool: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -9700,7 +9700,7 @@ Object {
|
||||
|
||||
exports[`regression tests hotkey 4 selects ellipse tool: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests hotkey 4 selects ellipse tool: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests hotkey 4 selects ellipse tool: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests hotkey 5 selects arrow tool: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -9877,7 +9877,7 @@ Object {
|
||||
|
||||
exports[`regression tests hotkey 5 selects arrow tool: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests hotkey 5 selects arrow tool: [end of test] number of renders 1`] = `8`;
|
||||
exports[`regression tests hotkey 5 selects arrow tool: [end of test] number of renders 1`] = `7`;
|
||||
|
||||
exports[`regression tests hotkey 6 selects line tool: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -10054,7 +10054,7 @@ Object {
|
||||
|
||||
exports[`regression tests hotkey 6 selects line tool: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests hotkey 6 selects line tool: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests hotkey 6 selects line tool: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests hotkey 7 selects draw tool: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -10231,7 +10231,7 @@ Object {
|
||||
|
||||
exports[`regression tests hotkey 7 selects draw tool: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests hotkey 7 selects draw tool: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests hotkey 7 selects draw tool: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests hotkey a selects arrow tool: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -10408,7 +10408,7 @@ Object {
|
||||
|
||||
exports[`regression tests hotkey a selects arrow tool: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests hotkey a selects arrow tool: [end of test] number of renders 1`] = `8`;
|
||||
exports[`regression tests hotkey a selects arrow tool: [end of test] number of renders 1`] = `7`;
|
||||
|
||||
exports[`regression tests hotkey d selects diamond tool: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -10559,7 +10559,7 @@ Object {
|
||||
|
||||
exports[`regression tests hotkey d selects diamond tool: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests hotkey d selects diamond tool: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests hotkey d selects diamond tool: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests hotkey e selects ellipse tool: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -10710,7 +10710,7 @@ Object {
|
||||
|
||||
exports[`regression tests hotkey e selects ellipse tool: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests hotkey e selects ellipse tool: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests hotkey e selects ellipse tool: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests hotkey l selects line tool: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -10887,7 +10887,7 @@ Object {
|
||||
|
||||
exports[`regression tests hotkey l selects line tool: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests hotkey l selects line tool: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests hotkey l selects line tool: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests hotkey r selects rectangle tool: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -11038,7 +11038,7 @@ Object {
|
||||
|
||||
exports[`regression tests hotkey r selects rectangle tool: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests hotkey r selects rectangle tool: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests hotkey r selects rectangle tool: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests hotkey x selects draw tool: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -11215,7 +11215,7 @@ Object {
|
||||
|
||||
exports[`regression tests hotkey x selects draw tool: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests hotkey x selects draw tool: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests hotkey x selects draw tool: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests make a group and duplicate it: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -11918,7 +11918,7 @@ Object {
|
||||
|
||||
exports[`regression tests make a group and duplicate it: [end of test] number of elements 1`] = `6`;
|
||||
|
||||
exports[`regression tests make a group and duplicate it: [end of test] number of renders 1`] = `22`;
|
||||
exports[`regression tests make a group and duplicate it: [end of test] number of renders 1`] = `21`;
|
||||
|
||||
exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -12158,7 +12158,7 @@ Object {
|
||||
|
||||
exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] number of renders 1`] = `19`;
|
||||
exports[`regression tests noop interaction after undo shouldn't create history entry: [end of test] number of renders 1`] = `18`;
|
||||
|
||||
exports[`regression tests pinch-to-zoom works: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -12247,7 +12247,7 @@ Object {
|
||||
|
||||
exports[`regression tests pinch-to-zoom works: [end of test] number of elements 1`] = `0`;
|
||||
|
||||
exports[`regression tests pinch-to-zoom works: [end of test] number of renders 1`] = `9`;
|
||||
exports[`regression tests pinch-to-zoom works: [end of test] number of renders 1`] = `8`;
|
||||
|
||||
exports[`regression tests rerenders UI on language change: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -12334,7 +12334,7 @@ Object {
|
||||
|
||||
exports[`regression tests rerenders UI on language change: [end of test] number of elements 1`] = `0`;
|
||||
|
||||
exports[`regression tests rerenders UI on language change: [end of test] number of renders 1`] = `6`;
|
||||
exports[`regression tests rerenders UI on language change: [end of test] number of renders 1`] = `5`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -13213,7 +13213,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [end of test] number of renders 1`] = `55`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [end of test] number of renders 1`] = `54`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] appState 1`] = `
|
||||
Object {
|
||||
@ -13651,7 +13651,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] number of renders 1`] = `28`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle ne (+5, +5)] number of renders 1`] = `27`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] appState 1`] = `
|
||||
Object {
|
||||
@ -14002,7 +14002,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] number of renders 1`] = `22`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle ne (-5, -5)] number of renders 1`] = `21`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] appState 1`] = `
|
||||
Object {
|
||||
@ -14270,7 +14270,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] number of renders 1`] = `16`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle nw (+5, +5)] number of renders 1`] = `15`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] appState 1`] = `
|
||||
Object {
|
||||
@ -14459,7 +14459,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] number of renders 1`] = `10`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle nw (-5, -5)] number of renders 1`] = `9`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] appState 1`] = `
|
||||
Object {
|
||||
@ -15285,7 +15285,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] number of renders 1`] = `52`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle se (+5, +5)] number of renders 1`] = `51`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] appState 1`] = `
|
||||
Object {
|
||||
@ -16008,7 +16008,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] number of renders 1`] = `46`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle se (-5, -5)] number of renders 1`] = `45`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] appState 1`] = `
|
||||
Object {
|
||||
@ -16632,7 +16632,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] number of renders 1`] = `40`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle sw (+5, +5)] number of renders 1`] = `39`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] appState 1`] = `
|
||||
Object {
|
||||
@ -17161,7 +17161,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] number of renders 1`] = `34`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [resize handle sw (-5, -5)] number of renders 1`] = `33`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] appState 1`] = `
|
||||
Object {
|
||||
@ -17644,7 +17644,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] number of renders 1`] = `31`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (+5, +5)] number of renders 1`] = `30`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] appState 1`] = `
|
||||
Object {
|
||||
@ -18038,7 +18038,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] number of renders 1`] = `25`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle ne (-5, -5)] number of renders 1`] = `24`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] appState 1`] = `
|
||||
Object {
|
||||
@ -18347,7 +18347,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] number of renders 1`] = `19`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (+5, +5)] number of renders 1`] = `18`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] appState 1`] = `
|
||||
Object {
|
||||
@ -18575,7 +18575,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] number of renders 1`] = `13`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle nw (-5, -5)] number of renders 1`] = `12`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] appState 1`] = `
|
||||
Object {
|
||||
@ -19454,7 +19454,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] number of renders 1`] = `55`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle se (+5, +5)] number of renders 1`] = `54`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] appState 1`] = `
|
||||
Object {
|
||||
@ -20228,7 +20228,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] number of renders 1`] = `49`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle se (-5, -5)] number of renders 1`] = `48`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] appState 1`] = `
|
||||
Object {
|
||||
@ -20901,7 +20901,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] number of renders 1`] = `43`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (+5, +5)] number of renders 1`] = `42`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] appState 1`] = `
|
||||
Object {
|
||||
@ -21477,7 +21477,7 @@ Object {
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] number of renders 1`] = `37`;
|
||||
exports[`regression tests resize an element, trying every resize handle: [unresize handle sw (-5, -5)] number of renders 1`] = `36`;
|
||||
|
||||
exports[`regression tests selecting 'Add to library' in context menu adds element to library: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -21628,7 +21628,7 @@ Object {
|
||||
|
||||
exports[`regression tests selecting 'Add to library' in context menu adds element to library: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests selecting 'Add to library' in context menu adds element to library: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests selecting 'Add to library' in context menu adds element to library: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests selecting 'Bring forward' in context menu brings element forward: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -21923,7 +21923,7 @@ Object {
|
||||
|
||||
exports[`regression tests selecting 'Bring forward' in context menu brings element forward: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests selecting 'Bring forward' in context menu brings element forward: [end of test] number of renders 1`] = `13`;
|
||||
exports[`regression tests selecting 'Bring forward' in context menu brings element forward: [end of test] number of renders 1`] = `12`;
|
||||
|
||||
exports[`regression tests selecting 'Bring to front' in context menu brings element to front: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -22218,7 +22218,7 @@ Object {
|
||||
|
||||
exports[`regression tests selecting 'Bring to front' in context menu brings element to front: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests selecting 'Bring to front' in context menu brings element to front: [end of test] number of renders 1`] = `13`;
|
||||
exports[`regression tests selecting 'Bring to front' in context menu brings element to front: [end of test] number of renders 1`] = `12`;
|
||||
|
||||
exports[`regression tests selecting 'Copy styles' in context menu copies styles: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -22369,7 +22369,7 @@ Object {
|
||||
|
||||
exports[`regression tests selecting 'Copy styles' in context menu copies styles: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests selecting 'Copy styles' in context menu copies styles: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests selecting 'Copy styles' in context menu copies styles: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests selecting 'Delete' in context menu deletes element: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -22552,7 +22552,7 @@ Object {
|
||||
|
||||
exports[`regression tests selecting 'Delete' in context menu deletes element: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests selecting 'Delete' in context menu deletes element: [end of test] number of renders 1`] = `8`;
|
||||
exports[`regression tests selecting 'Delete' in context menu deletes element: [end of test] number of renders 1`] = `7`;
|
||||
|
||||
exports[`regression tests selecting 'Duplicate' in context menu duplicates element: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -22788,7 +22788,7 @@ Object {
|
||||
|
||||
exports[`regression tests selecting 'Duplicate' in context menu duplicates element: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests selecting 'Duplicate' in context menu duplicates element: [end of test] number of renders 1`] = `8`;
|
||||
exports[`regression tests selecting 'Duplicate' in context menu duplicates element: [end of test] number of renders 1`] = `7`;
|
||||
|
||||
exports[`regression tests selecting 'Group selection' in context menu groups selected elements: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -23099,7 +23099,7 @@ Object {
|
||||
|
||||
exports[`regression tests selecting 'Group selection' in context menu groups selected elements: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests selecting 'Group selection' in context menu groups selected elements: [end of test] number of renders 1`] = `14`;
|
||||
exports[`regression tests selecting 'Group selection' in context menu groups selected elements: [end of test] number of renders 1`] = `13`;
|
||||
|
||||
exports[`regression tests selecting 'Paste styles' in context menu pastes styles: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -23925,7 +23925,7 @@ Object {
|
||||
|
||||
exports[`regression tests selecting 'Paste styles' in context menu pastes styles: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests selecting 'Paste styles' in context menu pastes styles: [end of test] number of renders 1`] = `22`;
|
||||
exports[`regression tests selecting 'Paste styles' in context menu pastes styles: [end of test] number of renders 1`] = `21`;
|
||||
|
||||
exports[`regression tests selecting 'Send backward' in context menu sends element backward: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -24220,7 +24220,7 @@ Object {
|
||||
|
||||
exports[`regression tests selecting 'Send backward' in context menu sends element backward: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests selecting 'Send backward' in context menu sends element backward: [end of test] number of renders 1`] = `12`;
|
||||
exports[`regression tests selecting 'Send backward' in context menu sends element backward: [end of test] number of renders 1`] = `11`;
|
||||
|
||||
exports[`regression tests selecting 'Send to back' in context menu sends element to back: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -24515,7 +24515,7 @@ Object {
|
||||
|
||||
exports[`regression tests selecting 'Send to back' in context menu sends element to back: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests selecting 'Send to back' in context menu sends element to back: [end of test] number of renders 1`] = `12`;
|
||||
exports[`regression tests selecting 'Send to back' in context menu sends element to back: [end of test] number of renders 1`] = `11`;
|
||||
|
||||
exports[`regression tests selecting 'Ungroup selection' in context menu ungroups selected group: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -24881,7 +24881,7 @@ Object {
|
||||
|
||||
exports[`regression tests selecting 'Ungroup selection' in context menu ungroups selected group: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests selecting 'Ungroup selection' in context menu ungroups selected group: [end of test] number of renders 1`] = `15`;
|
||||
exports[`regression tests selecting 'Ungroup selection' in context menu ungroups selected group: [end of test] number of renders 1`] = `14`;
|
||||
|
||||
exports[`regression tests shift click on selected element should deselect it on pointer up: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -25035,7 +25035,7 @@ Object {
|
||||
|
||||
exports[`regression tests shift click on selected element should deselect it on pointer up: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests shift click on selected element should deselect it on pointer up: [end of test] number of renders 1`] = `9`;
|
||||
exports[`regression tests shift click on selected element should deselect it on pointer up: [end of test] number of renders 1`] = `8`;
|
||||
|
||||
exports[`regression tests shift-click to multiselect, then drag: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -25343,7 +25343,7 @@ Object {
|
||||
|
||||
exports[`regression tests shift-click to multiselect, then drag: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests shift-click to multiselect, then drag: [end of test] number of renders 1`] = `18`;
|
||||
exports[`regression tests shift-click to multiselect, then drag: [end of test] number of renders 1`] = `17`;
|
||||
|
||||
exports[`regression tests shows 'Group selection' in context menu for multiple selected elements: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -25585,7 +25585,7 @@ Object {
|
||||
|
||||
exports[`regression tests shows 'Group selection' in context menu for multiple selected elements: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests shows 'Group selection' in context menu for multiple selected elements: [end of test] number of renders 1`] = `15`;
|
||||
exports[`regression tests shows 'Group selection' in context menu for multiple selected elements: [end of test] number of renders 1`] = `14`;
|
||||
|
||||
exports[`regression tests shows 'Ungroup selection' in context menu for group inside selected elements: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -25899,7 +25899,7 @@ Object {
|
||||
|
||||
exports[`regression tests shows 'Ungroup selection' in context menu for group inside selected elements: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests shows 'Ungroup selection' in context menu for group inside selected elements: [end of test] number of renders 1`] = `16`;
|
||||
exports[`regression tests shows 'Ungroup selection' in context menu for group inside selected elements: [end of test] number of renders 1`] = `15`;
|
||||
|
||||
exports[`regression tests shows context menu for canvas: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -25986,7 +25986,7 @@ Object {
|
||||
|
||||
exports[`regression tests shows context menu for canvas: [end of test] number of elements 1`] = `0`;
|
||||
|
||||
exports[`regression tests shows context menu for canvas: [end of test] number of renders 1`] = `3`;
|
||||
exports[`regression tests shows context menu for canvas: [end of test] number of renders 1`] = `2`;
|
||||
|
||||
exports[`regression tests shows context menu for element: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -26137,7 +26137,7 @@ Object {
|
||||
|
||||
exports[`regression tests shows context menu for element: [end of test] number of elements 1`] = `1`;
|
||||
|
||||
exports[`regression tests shows context menu for element: [end of test] number of renders 1`] = `7`;
|
||||
exports[`regression tests shows context menu for element: [end of test] number of renders 1`] = `6`;
|
||||
|
||||
exports[`regression tests single-clicking on a subgroup of a selected group should not alter selection: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -26945,7 +26945,7 @@ Object {
|
||||
|
||||
exports[`regression tests single-clicking on a subgroup of a selected group should not alter selection: [end of test] number of elements 1`] = `4`;
|
||||
|
||||
exports[`regression tests single-clicking on a subgroup of a selected group should not alter selection: [end of test] number of renders 1`] = `37`;
|
||||
exports[`regression tests single-clicking on a subgroup of a selected group should not alter selection: [end of test] number of renders 1`] = `36`;
|
||||
|
||||
exports[`regression tests spacebar + drag scrolls the canvas: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -27032,7 +27032,7 @@ Object {
|
||||
|
||||
exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of elements 1`] = `0`;
|
||||
|
||||
exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of renders 1`] = `6`;
|
||||
exports[`regression tests spacebar + drag scrolls the canvas: [end of test] number of renders 1`] = `5`;
|
||||
|
||||
exports[`regression tests supports nested groups: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -27749,7 +27749,7 @@ Object {
|
||||
|
||||
exports[`regression tests supports nested groups: [end of test] number of elements 1`] = `3`;
|
||||
|
||||
exports[`regression tests supports nested groups: [end of test] number of renders 1`] = `31`;
|
||||
exports[`regression tests supports nested groups: [end of test] number of renders 1`] = `30`;
|
||||
|
||||
exports[`regression tests switches from group of selected elements to another element on pointer down: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -28141,7 +28141,7 @@ Object {
|
||||
|
||||
exports[`regression tests switches from group of selected elements to another element on pointer down: [end of test] number of elements 1`] = `3`;
|
||||
|
||||
exports[`regression tests switches from group of selected elements to another element on pointer down: [end of test] number of renders 1`] = `18`;
|
||||
exports[`regression tests switches from group of selected elements to another element on pointer down: [end of test] number of renders 1`] = `17`;
|
||||
|
||||
exports[`regression tests switches selected element on pointer down: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -28423,7 +28423,7 @@ Object {
|
||||
|
||||
exports[`regression tests switches selected element on pointer down: [end of test] number of elements 1`] = `2`;
|
||||
|
||||
exports[`regression tests switches selected element on pointer down: [end of test] number of renders 1`] = `12`;
|
||||
exports[`regression tests switches selected element on pointer down: [end of test] number of renders 1`] = `11`;
|
||||
|
||||
exports[`regression tests two-finger scroll works: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -28512,7 +28512,7 @@ Object {
|
||||
|
||||
exports[`regression tests two-finger scroll works: [end of test] number of elements 1`] = `0`;
|
||||
|
||||
exports[`regression tests two-finger scroll works: [end of test] number of renders 1`] = `11`;
|
||||
exports[`regression tests two-finger scroll works: [end of test] number of renders 1`] = `10`;
|
||||
|
||||
exports[`regression tests undo/redo drawing an element: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -28991,7 +28991,7 @@ Object {
|
||||
|
||||
exports[`regression tests undo/redo drawing an element: [end of test] number of elements 1`] = `3`;
|
||||
|
||||
exports[`regression tests undo/redo drawing an element: [end of test] number of renders 1`] = `28`;
|
||||
exports[`regression tests undo/redo drawing an element: [end of test] number of renders 1`] = `27`;
|
||||
|
||||
exports[`regression tests updates fontSize & fontFamily appState: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -29078,7 +29078,7 @@ Object {
|
||||
|
||||
exports[`regression tests updates fontSize & fontFamily appState: [end of test] number of elements 1`] = `0`;
|
||||
|
||||
exports[`regression tests updates fontSize & fontFamily appState: [end of test] number of renders 1`] = `5`;
|
||||
exports[`regression tests updates fontSize & fontFamily appState: [end of test] number of renders 1`] = `4`;
|
||||
|
||||
exports[`regression tests zoom hotkeys: [end of test] appState 1`] = `
|
||||
Object {
|
||||
@ -29165,4 +29165,4 @@ Object {
|
||||
|
||||
exports[`regression tests zoom hotkeys: [end of test] number of elements 1`] = `0`;
|
||||
|
||||
exports[`regression tests zoom hotkeys: [end of test] number of renders 1`] = `5`;
|
||||
exports[`regression tests zoom hotkeys: [end of test] number of renders 1`] = `4`;
|
||||
|
@ -96,7 +96,7 @@ beforeEach(async () => {
|
||||
finger2.reset();
|
||||
|
||||
await setLanguage("en.json");
|
||||
render(<App />);
|
||||
render(<App offsetLeft={0} offsetTop={0} />);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -126,6 +126,10 @@ export type LibraryItems = readonly LibraryItem[];
|
||||
export interface ExcalidrawProps {
|
||||
width: number;
|
||||
height: number;
|
||||
/** if not supplied, calculated by Excalidraw */
|
||||
offsetLeft?: number;
|
||||
/** if not supplied, calculated by Excalidraw */
|
||||
offsetTop?: number;
|
||||
onChange?: (
|
||||
elements: readonly ExcalidrawElement[],
|
||||
appState: AppState,
|
||||
|
Loading…
x
Reference in New Issue
Block a user