diff options
Diffstat (limited to 'platform/ios/godot_view.mm')
-rw-r--r-- | platform/ios/godot_view.mm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/platform/ios/godot_view.mm b/platform/ios/godot_view.mm index 4537dc2985..5aff75ea04 100644 --- a/platform/ios/godot_view.mm +++ b/platform/ios/godot_view.mm @@ -151,7 +151,7 @@ static const float earth_gravity = 9.80665; } - (void)godot_commonInit { - self.contentScaleFactor = [UIScreen mainScreen].nativeScale; + self.contentScaleFactor = [UIScreen mainScreen].scale; [self initTouches]; @@ -363,7 +363,9 @@ static const float earth_gravity = 9.80665; ERR_FAIL_COND(tid == -1); CGPoint touchPoint = [touch locationInView:self]; CGPoint prev_point = [touch previousLocationInView:self]; - DisplayServerIOS::get_singleton()->touch_drag(tid, prev_point.x * self.contentScaleFactor, prev_point.y * self.contentScaleFactor, touchPoint.x * self.contentScaleFactor, touchPoint.y * self.contentScaleFactor); + CGFloat alt = [touch altitudeAngle]; + CGVector azim = [touch azimuthUnitVectorInView:self]; + DisplayServerIOS::get_singleton()->touch_drag(tid, prev_point.x * self.contentScaleFactor, prev_point.y * self.contentScaleFactor, touchPoint.x * self.contentScaleFactor, touchPoint.y * self.contentScaleFactor, [touch force] / [touch maximumPossibleForce], Vector2(azim.dx, azim.dy) * Math::cos(alt)); } } } |