This commit is contained in:
nGrave 2025-05-01 13:24:21 +02:00 committed by GitHub
commit 8c4d09cd68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 31 additions and 2 deletions

View file

@ -1033,10 +1033,18 @@ export function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement) {
? element.points.map(([x, y], i) => [x, y, element.pressures[i]])
: [[0, 0, 0.5]];
let size;
if (element.strokeWidth === 0.5) {
size = 1.5;
} else {
// existin stroke widths
size = element.strokeWidth * 4.25;
}
// Consider changing the options for simulated pressure vs real pressure
const options: StrokeOptions = {
simulatePressure: element.simulatePressure,
size: element.strokeWidth * 4.25,
size: size,
thinning: 0.6,
smoothing: 0.5,
streamline: 0.5,

View file

@ -120,6 +120,7 @@ import {
ArrowheadCrowfootIcon,
ArrowheadCrowfootOneIcon,
ArrowheadCrowfootOneOrManyIcon,
StrokeWidthFineIcon,
} from "../components/icons";
import { Fonts } from "../fonts";
@ -487,6 +488,12 @@ export const actionChangeStrokeWidth = register({
<ButtonIconSelect
group="stroke-width"
options={[
{
value: 0.5,
text: t("labels.fine"),
icon: StrokeWidthFineIcon,
testId: "strokeWidth-fine",
},
{
value: STROKE_WIDTH.thin,
text: t("labels.thin"),

View file

@ -2236,3 +2236,16 @@ export const elementLinkIcon = createIcon(
</g>,
tablerIconProps,
);
export const StrokeWidthFineIcon = createIcon(
<>
<path
d="M4.167 10h11.666"
stroke="currentColor"
strokeWidth="0.75"
strokeLinecap="round"
strokeLinejoin="round"
/>
</>,
modifiedTablerIconProps,
);

View file

@ -70,10 +70,11 @@
"crossHatch": "Cross-hatch",
"thin": "Thin",
"bold": "Bold",
"extraBold": "Extra bold",
"fine": "Fine",
"left": "Left",
"center": "Center",
"right": "Right",
"extraBold": "Extra bold",
"architect": "Architect",
"artist": "Artist",
"cartoonist": "Cartoonist",