Nice catch, tested and can confirm this to happen with SVN r59224M (FPC 3.0.4 x86_64-darwin-cocoa) under Mojave.
This appears to not happen under
- macOS High Sierra (10.13.6 - SVN r59225M FPC 3.0.4 x86_64-darwin-cocoa) or
- Linux (SVN r59224 FPC 3.0.4 x86_64-linux-gtk2).
You could probably submit a bugreport - not sure if it's related to the repaint issues under Mojave though.