diff --git a/src/constants.ts b/src/constants.ts index cb63a4d48..85da84981 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -263,6 +263,12 @@ export const ROUNDNESS = { * collaboration */ export const PRECEDING_ELEMENT_KEY = "__precedingElement__"; +export const ROUGHNESS = { + architect: 0, + artist: 1, + cartoonist: 2, +} as const; + export const DEFAULT_ELEMENT_PROPS: { strokeColor: ExcalidrawElement["strokeColor"]; backgroundColor: ExcalidrawElement["backgroundColor"]; @@ -278,7 +284,7 @@ export const DEFAULT_ELEMENT_PROPS: { fillStyle: "hachure", strokeWidth: 1, strokeStyle: "solid", - roughness: 1, + roughness: ROUGHNESS.artist, opacity: 100, locked: false, }; diff --git a/src/renderer/renderElement.ts b/src/renderer/renderElement.ts index 77ea14587..215e281c6 100644 --- a/src/renderer/renderElement.ts +++ b/src/renderer/renderElement.ts @@ -36,6 +36,7 @@ import { BOUND_TEXT_PADDING, MAX_DECIMALS_FOR_SVG_EXPORT, MIME_TYPES, + ROUGHNESS, SVG_NS, } from "../constants"; import { getStroke, StrokeOptions } from "perfect-freehand"; @@ -416,7 +417,8 @@ export const generateRoughOptions = ( hachureGap: element.strokeWidth * 4, roughness: element.roughness, stroke: element.strokeColor, - preserveVertices: continuousPath, + preserveVertices: + continuousPath || element.roughness < ROUGHNESS.cartoonist, }; switch (element.type) {