Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential directions to improve the lagging #263

Open
skyrandomlab opened this issue Aug 17, 2021 · 4 comments
Open

Potential directions to improve the lagging #263

skyrandomlab opened this issue Aug 17, 2021 · 4 comments

Comments

@skyrandomlab
Copy link

Do you know which part of the codes or functions can be potential thresholds that impair the performance? While the functions of minipaint are awesome, the lags are actually observable (compared to some other painting tools like kleki.com or https://github.com/cojapacze/sketchpad, etc), and it's especially serious when Pressure is turn on. For example, although there is no problem to draw, when we draw curves with the pressure turned on, there are clear zig-zags. Is it possible to improve this issue or do you have any idea?

@viliusle
Copy link
Owner

  • I need to understand issue very well, is it lag or "zig-zags", and what is "zig-zags" exactly? Issue is lag, correct? If not, please specify.
  • When does it happens, from the start, or later if you don't release for long time? Basically do you see same lag first minute and after 5 minutes drawing?
  • What device do you use? if tablet, is it old?

During user actions, I collect coordinates where to draw, and I render from these coordinates. Because screen needs to be updated multiple times per second, on old/mobile devices it maybe be too much to get perfect user experience. Solution could be draw directly, without collecting coordinates, but I would not be able to render curves nicely, it would have ugly edges. (see attachment, left side is processed to "pretify" user input.
Brush-#2
)

@viliusle
Copy link
Owner

viliusle commented Aug 19, 2021

But we should probably use raster method, not vector during paint. It could fix lag, but of course I would need to find a way to retain feature for "nice curves" (left side of attachment above).

@skyrandomlab
Copy link
Author

Hi, sorry I didn't notice the question has got replied XD. I tested it on a windows laptop and a Linux laptop (with i7 6600) and identify a similar drawing result as you showed on the picture. When the brush without pressure is used, it prettifies the input and generates nice curves. (However, we may not want the program to change (or change too much) the input.) Using the brush with pressure, or using the pencil tool, there is no prettify, and you can see the polygon corners (which I called zig-zag before) as you showed in the left picture. I was thinking it's because the program collects the points too slow or too few. Do you think it helps or it's possible to collect more points? This can be of the same issue as the lag when drawing - there is some lags, less than 1 sec, of course, but you can feel it when drawing. Below the first pic is from minipaint, and the second is from the other tool mentioned before. Do you think they use raster method?
minipaint

Screenshot (10)

@viliusle
Copy link
Owner

Hi, sorry I didn't notice the question has got replied XD

Same for me this time. But I think I understand what you mean. When I try to draw line from left to right using brush using constant speed, but not too fast, I see gap between mouse pointer and actual line. And it does not matter if "prettify" is activated or not. I will need to investigate it.

p.s. if prettify is not what you want and you want ability to turn this off, please submit separate issue with reasons why. Right now some points are removed while drawing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants