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
No known key found for this signature in database
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,