steveruizok / perfect-freehand

Draw perfect pressure-sensitive freehand lines.
https://perfectfreehand.com
MIT License
4.52k stars 159 forks source link

[Bug] The Troke drawing doesn't look good in the html canvas #76

Open nhonnh2 opened 9 months ago

nhonnh2 commented 9 months ago

signaturecanvas I have an option for getStroke but the resulting stroke doesn't feel smooth.

const options = {
  size: 3,
  thinning: 0.2,
  smoothing: 1,
  streamline: 0.1,
  easing: (t) => t,
  start: {
    taper: 0,
    easing: (t) => t,
    cap: true,
  },
  end: {
    taper: 10,
    easing: (t) => t,
    cap: true,
  },
};

My canvas have width={440} ; height={220}

Can you help me make it more beautiful?

sourab-updot commented 7 months ago

Same issue in Svelte as well

hitesh0902 commented 7 months ago

try to use high DPI canvas

const width = 500;
const height = 500;
const scale = 2;

<canvas width={width * scale} height={height * scale} style={{ width: width, height: height }}></canvas>