mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-25 02:10:38 +02:00
fix creation of regular text
This commit is contained in:
@@ -362,6 +362,8 @@ export const convertToExcalidrawElements = (
|
|||||||
excalidrawElement = {
|
excalidrawElement = {
|
||||||
width: metrics.width,
|
width: metrics.width,
|
||||||
height: metrics.height,
|
height: metrics.height,
|
||||||
|
fontFamily,
|
||||||
|
fontSize,
|
||||||
...elementWithid,
|
...elementWithid,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -46,9 +46,10 @@ export interface ImportedDataState {
|
|||||||
source?: string;
|
source?: string;
|
||||||
elements?:
|
elements?:
|
||||||
| readonly (
|
| readonly (
|
||||||
|
| ExcalidrawElement
|
||||||
| ({
|
| ({
|
||||||
type: Exclude<ExcalidrawElement["type"], "text">;
|
type: Exclude<ExcalidrawGenericElement["type"], "selection">;
|
||||||
id?: ExcalidrawElement["id"];
|
id?: ExcalidrawGenericElement["id"];
|
||||||
label?: {
|
label?: {
|
||||||
text: string;
|
text: string;
|
||||||
fontSize?: number;
|
fontSize?: number;
|
||||||
@@ -60,6 +61,8 @@ export interface ImportedDataState {
|
|||||||
| ({
|
| ({
|
||||||
type: "text";
|
type: "text";
|
||||||
text: string;
|
text: string;
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
id?: ExcalidrawTextElement["id"];
|
id?: ExcalidrawTextElement["id"];
|
||||||
} & Partial<ExcalidrawTextElement>)
|
} & Partial<ExcalidrawTextElement>)
|
||||||
| ({
|
| ({
|
||||||
|
@@ -212,6 +212,12 @@ export default function App({ appTitle, useCustom, customArgs }: AppProps) {
|
|||||||
start: { type: "rectangle", id: "rect-1" },
|
start: { type: "rectangle", id: "rect-1" },
|
||||||
end: { type: "ellipse" },
|
end: { type: "ellipse" },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: "text",
|
||||||
|
x: 300,
|
||||||
|
y: 100,
|
||||||
|
text: "HELLO WORLD!",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
null,
|
null,
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user