mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: center and scale solid background on top of fancyBackground
This commit is contained in:
parent
e00764a937
commit
38fd4fb165
2 changed files with 24 additions and 10 deletions
|
@ -89,20 +89,21 @@ export const exportToCanvas = async (
|
|||
exportWithFancyBackground &&
|
||||
appState.fancyBackgroundImageKey !== "solid"
|
||||
) {
|
||||
const commonBounds = getCommonBounds(elements);
|
||||
const contentSize: Dimensions = {
|
||||
width: distance(commonBounds[0], commonBounds[2]),
|
||||
height: distance(commonBounds[1], commonBounds[3]),
|
||||
};
|
||||
|
||||
await applyFancyBackgroundOnCanvas({
|
||||
canvas,
|
||||
fancyBackgroundImageKey: appState.fancyBackgroundImageKey,
|
||||
backgroundColor: viewBackgroundColor,
|
||||
exportScale: scale,
|
||||
theme: appState.exportWithDarkMode ? THEME.DARK : THEME.LIGHT,
|
||||
contentSize,
|
||||
});
|
||||
|
||||
const commonBounds = getCommonBounds(elements);
|
||||
const contentSize: Dimensions = {
|
||||
width: distance(commonBounds[0], commonBounds[2]),
|
||||
height: distance(commonBounds[1], commonBounds[3]),
|
||||
};
|
||||
|
||||
scrollXAdjustment = (width - contentSize.width - padding * 2) / 2;
|
||||
scrollYAdjustment = (height - contentSize.height - padding * 2) / 2;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue