PaintBucket icon indicating copy to clipboard operation
PaintBucket copied to clipboard

Fill falls short by 1 pixel

Open dgwight opened this issue 9 years ago • 4 comments

The fill seems to be falling short by 1 pixel in all directions. This could be from the colors mixing along the edge and not being the same color. Either way I'd love it if the fill could be extended by the extra pixel. I threw a screenshot so you know what I am talking about img_0642

dgwight avatar Jul 24 '16 02:07 dgwight

@jflinter I hacked around and got it to work for me for now, but I probably slowed down the algorithm

dgwight avatar Jul 25 '16 22:07 dgwight

@dylangwight - I sadly don't have time to work on this right now, although I'll review a PR if you send it my way (although I won't want to merge anything that slows things down). Have you played with the tolerance parameter?

jflinter avatar Jul 27 '16 02:07 jflinter

@dgwight What was the hack you used for this problem?

fabulouspanda avatar Aug 22 '17 17:08 fabulouspanda

@dgwight What was the hack you used for this problem?

It isn't due to the fill algorithm, it's due to antialiasing being turned on for the graphics context. A small antialiased strand is being drawn around the paths which remains after the fill operation. Best way to fix it is really just to draw the shapes without antialiasing. This bit of code fixes it: let context = UIGraphicsGetCurrentContext() context?.setShouldAntialias(false)

ibrust avatar Nov 28 '20 01:11 ibrust