restore polygon
state on type conversions
This commit is contained in:
parent
7c3190d4bb
commit
54b124c4f4
@ -460,6 +460,7 @@ export const newLinearElement = (
|
|||||||
opts: {
|
opts: {
|
||||||
type: ExcalidrawLinearElement["type"];
|
type: ExcalidrawLinearElement["type"];
|
||||||
points?: ExcalidrawLinearElement["points"];
|
points?: ExcalidrawLinearElement["points"];
|
||||||
|
polygon?: ExcalidrawLineElement["polygon"];
|
||||||
} & ElementConstructorOpts,
|
} & ElementConstructorOpts,
|
||||||
): NonDeleted<ExcalidrawLinearElement> => {
|
): NonDeleted<ExcalidrawLinearElement> => {
|
||||||
const element = {
|
const element = {
|
||||||
@ -475,7 +476,7 @@ export const newLinearElement = (
|
|||||||
if (isLineElement(element)) {
|
if (isLineElement(element)) {
|
||||||
const lineElement: NonDeleted<ExcalidrawLineElement> = {
|
const lineElement: NonDeleted<ExcalidrawLineElement> = {
|
||||||
...element,
|
...element,
|
||||||
polygon: false,
|
polygon: opts.polygon ?? false,
|
||||||
};
|
};
|
||||||
|
|
||||||
return lineElement;
|
return lineElement;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user