diff --git a/packages/element/src/renderElement.ts b/packages/element/src/renderElement.ts index 8c17863ee03b..cdb3ea10824f 100644 --- a/packages/element/src/renderElement.ts +++ b/packages/element/src/renderElement.ts @@ -716,7 +716,7 @@ export const renderSelectionElement = ( // https://stackoverflow.com/questions/7530593/html5-canvas-and-line-width/7531540#7531540 // TODO can be be improved by offseting to the negative when user selects // from right to left - const offset = 0.5 / appState.zoom.value; + const offset = 1 / appState.zoom.value; context.fillRect(offset, offset, element.width, element.height); context.lineWidth = 1 / appState.zoom.value; @@ -759,7 +759,7 @@ export const renderElement = ( ); context.fillStyle = "rgba(0, 0, 200, 0.04)"; - context.lineWidth = FRAME_STYLE.strokeWidth / appState.zoom.value; + context.lineWidth = FRAME_STYLE.strokeWidth * appState.zoom.value; context.strokeStyle = FRAME_STYLE.strokeColor; // TODO change later to only affect AI frames @@ -1117,7 +1117,7 @@ export function getFreedrawOutlinePoints(element: ExcalidrawFreeDrawElement) { // Consider changing the options for simulated pressure vs real pressure const options: StrokeOptions = { simulatePressure: element.simulatePressure, - size: element.strokeWidth * 4.25, + size: element.strokeWidth * 4.5, thinning: 0.6, smoothing: 0.5, streamline: 0.5, @@ -1135,7 +1135,7 @@ function med(A: number[], B: number[]) { // Trim SVG path data so number are each two decimal points. This // improves SVG exports, and prevents rendering errors on points // with long decimals. -const TO_FIXED_PRECISION = /(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g; +const TO_FIXED_PRECISION = /(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,3})(([0-9]|e|-)*)/g; function getSvgPathFromStroke(points: number[][]): string { if (!points.length) {