Skip to content

Commit

Permalink
display(iOS): fix scaling issue when display zoom is enabled
Browse files Browse the repository at this point in the history
Fixes #6736
  • Loading branch information
osy committed Nov 25, 2024
1 parent 44186cd commit c689f8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Platform/iOS/Display/VMDisplayMetalViewController+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ static inline CGFloat CGPointToPixel(CGFloat point) {
#if defined(TARGET_OS_VISION) && TARGET_OS_VISION
return point * 2.0;
#else
return point * [UIScreen mainScreen].scale; // FIXME: multiple screens?
return point * [UIScreen mainScreen].nativeScale; // FIXME: multiple screens?
#endif
}

static inline CGFloat CGPixelToPoint(CGFloat pixel) {
#if defined(TARGET_OS_VISION) && TARGET_OS_VISION
return pixel / 2.0;
#else
return pixel / [UIScreen mainScreen].scale; // FIXME: multiple screens?
return pixel / [UIScreen mainScreen].nativeScale; // FIXME: multiple screens?
#endif
}

0 comments on commit c689f8f

Please sign in to comment.