implement stroke style (#1571)

This commit is contained in:
David Luzar 2020-05-14 17:04:33 +02:00 committed by GitHub
parent f6be200388
commit 39c56a4c01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 459 additions and 9 deletions

View file

@ -30,6 +30,7 @@ it("clones arrow element", () => {
backgroundColor: "transparent",
fillStyle: "hachure",
strokeWidth: 1,
strokeStyle: "solid",
roughness: 1,
opacity: 100,
});
@ -73,6 +74,7 @@ it("clones text element", () => {
backgroundColor: "transparent",
fillStyle: "hachure",
strokeWidth: 1,
strokeStyle: "solid",
roughness: 1,
opacity: 100,
text: "hello",

View file

@ -17,6 +17,7 @@ type ElementConstructorOpts = {
backgroundColor: ExcalidrawGenericElement["backgroundColor"];
fillStyle: ExcalidrawGenericElement["fillStyle"];
strokeWidth: ExcalidrawGenericElement["strokeWidth"];
strokeStyle: ExcalidrawGenericElement["strokeStyle"];
roughness: ExcalidrawGenericElement["roughness"];
opacity: ExcalidrawGenericElement["opacity"];
width?: ExcalidrawGenericElement["width"];
@ -33,6 +34,7 @@ function _newElementBase<T extends ExcalidrawElement>(
backgroundColor,
fillStyle,
strokeWidth,
strokeStyle,
roughness,
opacity,
width = 0,
@ -53,6 +55,7 @@ function _newElementBase<T extends ExcalidrawElement>(
backgroundColor,
fillStyle,
strokeWidth,
strokeStyle,
roughness,
opacity,
seed: rest.seed ?? randomInteger(),

View file

@ -8,6 +8,7 @@ type _ExcalidrawElementBase = Readonly<{
backgroundColor: string;
fillStyle: string;
strokeWidth: number;
strokeStyle: "solid" | "dashed" | "dotted";
roughness: number;
opacity: number;
width: number;