Avoid floating-point exceptions while drawing underwave