kopia lustrzana https://github.com/Tldraw/Tldraw
Update pasteExcalidrawContent.ts
rodzic
ca9c12f6a8
commit
e5a4887ea6
|
@ -11,6 +11,7 @@ import {
|
||||||
TLDefaultFontStyle,
|
TLDefaultFontStyle,
|
||||||
TLDefaultHorizontalAlignStyle,
|
TLDefaultHorizontalAlignStyle,
|
||||||
TLDefaultSizeStyle,
|
TLDefaultSizeStyle,
|
||||||
|
TLDefaultTextAlignStyle,
|
||||||
TLOpacityType,
|
TLOpacityType,
|
||||||
TLShapeId,
|
TLShapeId,
|
||||||
Vec,
|
Vec,
|
||||||
|
@ -282,7 +283,7 @@ export async function pasteExcalidrawContent(editor: Editor, clipboard: any, poi
|
||||||
font: fontFamilyToFontType[element.fontFamily] ?? 'draw',
|
font: fontFamilyToFontType[element.fontFamily] ?? 'draw',
|
||||||
color: colorsToColors[element.strokeColor] ?? 'black',
|
color: colorsToColors[element.strokeColor] ?? 'black',
|
||||||
text: element.text,
|
text: element.text,
|
||||||
textAlign: textAlignToAlignTypes[element.textAlign],
|
textAlign: textAlignToTextAlignTypes[element.textAlign],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
|
@ -472,6 +473,12 @@ const textAlignToAlignTypes: Record<string, TLDefaultHorizontalAlignStyle> = {
|
||||||
right: 'end',
|
right: 'end',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const textAlignToTextAlignTypes: Record<string, TLDefaultTextAlignStyle> = {
|
||||||
|
left: 'start',
|
||||||
|
center: 'middle',
|
||||||
|
right: 'end',
|
||||||
|
}
|
||||||
|
|
||||||
const arrowheadsToArrowheadTypes: Record<string, TLArrowShapeArrowheadStyle> = {
|
const arrowheadsToArrowheadTypes: Record<string, TLArrowShapeArrowheadStyle> = {
|
||||||
arrow: 'arrow',
|
arrow: 'arrow',
|
||||||
dot: 'dot',
|
dot: 'dot',
|
||||||
|
|
Ładowanie…
Reference in New Issue