(x, dpi, n)
| 54 | # this maybe simplified if / when we adopt consistent rounding for |
| 55 | # pixel size across the whole library |
| 56 | def correct_roundoff(x, dpi, n): |
| 57 | if int(x*dpi) % n != 0: |
| 58 | if int(np.nextafter(x, np.inf)*dpi) % n == 0: |
| 59 | x = np.nextafter(x, np.inf) |
| 60 | elif int(np.nextafter(x, -np.inf)*dpi) % n == 0: |
| 61 | x = np.nextafter(x, -np.inf) |
| 62 | return x |
| 63 | |
| 64 | wnew = int(w * dpi / n) * n / dpi |
| 65 | hnew = int(h * dpi / n) * n / dpi |
no outgoing calls
no test coverage detected
searching dependent graphs…