M_SQRT2
if (diff < -fThreshold / M_SQRT2)
diff += fThreshold / M_SQRT2;
else if (diff > fThreshold / M_SQRT2)
diff -= fThreshold / M_SQRT2;
correction = M_SQRT2 * halfPenSize;
correction = max_c(correction, M_SQRT2 * halfPenSize);