mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feats: 为 snow-shot 适配功能
This commit is contained in:
parent
82525f6c13
commit
5652b8e01b
35 changed files with 942 additions and 286 deletions
|
@ -46,6 +46,7 @@ import type {
|
|||
ExcalidrawArrowElement,
|
||||
FixedSegment,
|
||||
ExcalidrawElbowArrowElement,
|
||||
ExcalidrawBlurElement,
|
||||
} from "./types";
|
||||
|
||||
export type ElementConstructorOpts = MarkOptional<
|
||||
|
@ -212,6 +213,25 @@ export const newMagicFrameElement = (
|
|||
return frameElement;
|
||||
};
|
||||
|
||||
export const newBlurElement = (
|
||||
opts: {
|
||||
blur: number;
|
||||
} & ElementConstructorOpts,
|
||||
): NonDeleted<ExcalidrawBlurElement> => {
|
||||
const blurElement = newElementWith(
|
||||
{
|
||||
..._newElementBase<ExcalidrawBlurElement>("blur", opts),
|
||||
type: "blur",
|
||||
blur: opts.blur,
|
||||
fillStyle: "solid",
|
||||
backgroundColor: "#000000",
|
||||
},
|
||||
{},
|
||||
);
|
||||
|
||||
return blurElement;
|
||||
};
|
||||
|
||||
/** computes element x/y offset based on textAlign/verticalAlign */
|
||||
const getTextElementPositionOffsets = (
|
||||
opts: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue