feat: scale up small exports with fancy background

This commit is contained in:
Arnošt Pleskot
2023-08-15 23:41:52 +02:00
parent d27856a967
commit 4c8cf9c91c
6 changed files with 64 additions and 14 deletions

View File

@@ -1,4 +1,5 @@
import {
DEFAULT_EXPORT_PADDING,
FANCY_BACKGROUND_IMAGES,
FANCY_BG_BORDER_RADIUS,
FANCY_BG_PADDING,
@@ -12,6 +13,10 @@ import { getScaleToFill } from "../packages/utils";
import { roundRect } from "../renderer/roundRect";
import { AppState, Dimensions } from "../types";
export const getFancyBackgroundPadding = (
exportPadding = DEFAULT_EXPORT_PADDING,
) => FANCY_BG_PADDING + FANCY_BG_BORDER_RADIUS + exportPadding;
const addImageBackground = (
context: CanvasRenderingContext2D,
canvasDimensions: Dimensions,