Set gridLineWidth to 1 for testGridLinePattern - it defaults to 0.3 which complicates the rounding logic.