mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-14 21:10:37 +02:00
feat: center and scale solid background on top of fancyBackground
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user