Function
transformPoint
(point, scalex=None, scaley=None, translatex=None, translatey=None)
Source from the content-addressed store, hash-verified
| 47 | |
| 48 | |
| 49 | def transformPoint(point, scalex=None, scaley=None, translatex=None, translatey=None): |
| 50 | if scalex == None: |
| 51 | scalex = DEFAULT_SCALEX |
| 52 | if scaley == None: |
| 53 | scaley = DEFAULT_SCALEY |
| 54 | if translatex == None: |
| 55 | translatex = DEFAULT_TRANSLATEX |
| 56 | if translatey == None: |
| 57 | translatey = DEFAULT_TRANSLATEY |
| 58 | |
| 59 | return (int(point[0] * scalex + translatex), |
| 60 | int(point[1] * scaley + translatey)) |
| 61 | |
| 62 | |
| 63 | # Directions of each axis: |
Tested by
no test coverage detected