Pinch improvements and getDeviceTransformation()

- Pinching code has been improved
- getDeviceTransformation() now works correctly

Important: The device transformation is currently not taking DPI into account!