Open chayleaf opened 6 years ago
It is a resizing issue (blending is how the colors mix). After playing with different canvas sizes, I think it's computing only some of the pixels in the line instead of using all of them (which is why ms paint creates a gradient).
MS Paint in Win98/95, which is what jspaint is mainly a clone of, doesn't seem to support this, although I could add it as an option, probably without too much difficulty (if my Win10 install wasn't super broken rn)
(you can try it here if you want: https://copy.sh/v86/?profile=windows98)
Played with imageSmoothQuality to see if possible, but I couldn't quite get a clean gradient:
@Mikejmoffitt points out selections are always scaled with nearest neighbor sampling.
Looks like gradients work in the Windows XP version, but not Windows 98. JS Paint is primarily targeting parity with Windows 98. I'm not ruling out this feature, because it seems fun to support various old hacks, but I'm not interested in working on it at this point.
MS Paint might use "box sampling" so that all pixels contribute to the output.
I don't really know the details, but mspaint allowed you to do gradients like this: http://www.nerdparadise.com/mspaint/lineargradient which isn't possible in jspaint.