lavagna icon indicating copy to clipboard operation
lavagna copied to clipboard

Spikes when large line is used

Open alepez opened this issue 2 years ago • 2 comments

Describe the bug When the line width is large, little cursor movements generate spikes.

To Reproduce

  1. Select maximum line width
  2. keep pressing, do small movements

Expected behavior

A roundish shape should be drawn.

Instead, these spikes appear on the screen:

image

alepez avatar May 22 '23 13:05 alepez

There is some extra context semi-related to this issue that might be useful:

If the code is modified to ensure that every stroke is configured with LineJoin::Round and LineCap::Round, the lines will generally look more like they have been drawn with a circular brush (with a potential performance cost due to the extra triangles needed for that roundness).

However, even with a round brushstroke, spikes can still appear, and I believe the root cause there is https://github.com/nical/lyon/issues/891. One workaround is to split the path whenever that issue would come up, although I haven't tested if that would tank performance.

patowen avatar Apr 13 '24 13:04 patowen

Thanks for finding out the root cause! I'll probably implement the workaround you have suggested.

alepez avatar Apr 15 '24 21:04 alepez