1j01 / jspaint

🎨 Classic MS Paint, REVIVED + ✨Extras
https://jspaint.app/about
MIT License
7.25k stars 568 forks source link

Fix large square brush #163

Closed AshtrayShetty closed 2 years ago

AshtrayShetty commented 4 years ago

On selecting the large square in the brush tool, there are certain white "gaps" left on drawing. Here is a screenshot:

Screenshot (5)

This throws off the feel of the app working like MS Paint. Other than that, great work. Hope you come up with a fix soon!!!

TheAwesome98-Real commented 4 years ago

Happened to me too. Thought it was cuz i was on mobile safari but no

1j01 commented 4 years ago

This is a regression from a half-implemented performance optimization. I was planning on making it draw a set of lines with WebGL so that it can draw a segment of the brush stroke at once, instead of as a series of drawImage calls of a pre-rendered brush. So I made it detect the outline of the shape, for a list of points to use as offsets for (both the start and end points of) a set of lines.

This could be fixed by either:

AshtrayShetty commented 4 years ago

You could also play with the context manager attributes such as lineCap, lineJoin, etc.

1j01 commented 4 years ago

@AshtrayShetty I'm not using CanvasRenderingContext2D's line rendering because it doesn't support disabling antialiasing. It's ironic because I'm going for a style of line (aliased / "pixely") that should be computationally simpler to draw, but I have to jump thru hoops to do it.