feat: move aspect ratio into constant

This commit is contained in:
Arnošt Pleskot 2023-09-20 15:59:25 +02:00
parent 5afa3fe31d
commit 04295d7096
No known key found for this signature in database
2 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,5 @@
import cssVariables from "./css/variables.module.scss";
import { AppProps, DataURL } from "./types";
import { AppProps, DataURL, Dimensions } from "./types";
import { ExcalidrawElement, FontFamilyValues } from "./element/types";
import { COLOR_PALETTE } from "./colors";
@ -246,6 +246,10 @@ export const FANCY_BG_BORDER_RADIUS = 12; // px
export const FANCY_BG_LOGO_PADDING = 20; // px
export const FANCY_BG_LOGO_BOTTOM_PADDING = 12; // px
export const FANCY_BG_INCLUDE_LOGO = true;
export const DEFAULT_FANCY_BACKGROUND_RATIO: Dimensions = {
width: 16,
height: 9,
};
export const DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT = 1440;

View File

@ -15,6 +15,7 @@ import {
import { AppState, BinaryFiles, Dimensions, ExportPadding } from "../types";
import {
DEFAULT_EXPORT_PADDING,
DEFAULT_FANCY_BACKGROUND_RATIO,
FANCY_BACKGROUND_IMAGES,
FANCY_BG_INCLUDE_LOGO,
SVG_NS,
@ -89,7 +90,7 @@ export const exportToCanvas = async (
onlyExportingSingleFrame,
exportingWithFancyBackground,
opts: {
aspectRatio: { width: 16, height: 9 },
aspectRatio: DEFAULT_FANCY_BACKGROUND_RATIO,
clipFrame: false,
},
});
@ -255,7 +256,7 @@ export const exportToSvg = async (
onlyExportingSingleFrame,
exportingWithFancyBackground,
opts: {
aspectRatio: { width: 16, height: 9 },
aspectRatio: DEFAULT_FANCY_BACKGROUND_RATIO,
clipFrame: false,
},
});