Which version of the game? Release, Snapshot, Android, or unaffiliated mod
It's a rare occurance and I think it's just in Jacob1's mod. Usually works with particles already on screen and bmtl
Because it looks like when I was building a foundation for my trading hub it happened. I think that the mod thinks that the brush is bigger if it is between frames so it may be a thing about a long waiting will result in the frame update time being missalined with the detection and it's rounding up the mouse position. The game basically sees the brush slightly over a pixel yet fills it entirely. or it could be floating point like in minecraft or something.
I still don't do code though.
your hypothesis is probably incorrect. TPT uses ints for nearly everything, and is practically afraid of floats in the SRC (My opinion).
This seems more like your mouse being junk than the game being buggy.
TPT is open source, and I believe moonheart is one of the code contributors.
Anyway, since he sees a 5x1 brush on the screen, that means TPT knows the correct size.
It is more likely for the error to occur when TPT tries to draw the store size rather than the mouse (falsefully)accurately moving into 4 positions to draw a bigger shape in a brief moment.