Answer the question
In order to leave comments, you need to log in
How to draw such a line with your finger?
Maybe it's not a line, but a filled contour. But it is drawn in one motion, the width depends on pressing.
----------
While the idea is to calculate the coordinates of points lying on a line perpendicular to the line connecting the previous point with the current one, at a distance of (brush thickness * pressure * size + 1) / 2 and build two paths using these points, closed in a loop.
Answer the question
In order to leave comments, you need to log in
It turned out something like this
The first "skeleton" of the line. The width is the same everywhere, because The emulator does not have pressure force.
Filled It
remains to overcome glitches on sharp bends.
Thickness can be affected by swipe speed, with limits on the maximum. Taper at the ends, taking into account the slowdown - for example, at the end or at the beginning of the draw, holding the finger in place for a short time will lead to the "blunting" of the sharp end.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question