mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix creation of regular text
This commit is contained in:
parent
afc98c2d47
commit
5b458288e7
3 changed files with 13 additions and 2 deletions
|
@ -362,6 +362,8 @@ export const convertToExcalidrawElements = (
|
|||
excalidrawElement = {
|
||||
width: metrics.width,
|
||||
height: metrics.height,
|
||||
fontFamily,
|
||||
fontSize,
|
||||
...elementWithid,
|
||||
};
|
||||
|
||||
|
|
|
@ -46,9 +46,10 @@ export interface ImportedDataState {
|
|||
source?: string;
|
||||
elements?:
|
||||
| readonly (
|
||||
| ExcalidrawElement
|
||||
| ({
|
||||
type: Exclude<ExcalidrawElement["type"], "text">;
|
||||
id?: ExcalidrawElement["id"];
|
||||
type: Exclude<ExcalidrawGenericElement["type"], "selection">;
|
||||
id?: ExcalidrawGenericElement["id"];
|
||||
label?: {
|
||||
text: string;
|
||||
fontSize?: number;
|
||||
|
@ -60,6 +61,8 @@ export interface ImportedDataState {
|
|||
| ({
|
||||
type: "text";
|
||||
text: string;
|
||||
x: number;
|
||||
y: number;
|
||||
id?: ExcalidrawTextElement["id"];
|
||||
} & Partial<ExcalidrawTextElement>)
|
||||
| ({
|
||||
|
|
|
@ -212,6 +212,12 @@ export default function App({ appTitle, useCustom, customArgs }: AppProps) {
|
|||
start: { type: "rectangle", id: "rect-1" },
|
||||
end: { type: "ellipse" },
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
x: 300,
|
||||
y: 100,
|
||||
text: "HELLO WORLD!",
|
||||
},
|
||||
],
|
||||
null,
|
||||
),
|
||||
|
|
Loading…
Add table
Reference in a new issue