I am building a Flutter app that allows you to draw pixel art on a canvas using CustomPainter. My Paint()
method looks like so:
final paint = Paint()
..color = Colors.deepPurple
..style = PaintingStyle.fill
..isAntiAlias = false
..strokeWidth = 1;
Which gives me something like this (zoomed in):
After testing this I realized that that strokeWidth = 1
does not mean 1 pixel. I can change it to .1
or something, but that then seems to be doing sub-pixel painting. How can I get my stroke width to be exactly 1 pixel?
I looked through the documentation and I'm not understanding why this is happening.