fog: fix issues with negative fog coords (may fix #10529)