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