Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/element/src/renderElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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) {
Expand Down