sorry, i not read your code,
but your description sounds like you use the mouse position for paint
( and not use the mousePressed )
only to compare with other ideas, pls check recent
Help with a "Drawing" App second code
so you have color adjust and brush size, but no SPRAY tool
possibly you have that already.