diff --git a/res/about/ios-version.gmi b/res/about/ios-version.gmi

index d04a2a86..a42130b0 100644

--- a/res/about/ios-version.gmi

+++ b/res/about/ios-version.gmi

@@ -10,6 +10,7 @@

+* (iPad) Fixed incorrect display scaling when launching the app in Slide Over or Split View mode.

diff --git a/src/ios.h b/src/ios.h

index 768733fc..f501d504 100644

--- a/src/ios.h

+++ b/src/ios.h

@@ -43,6 +43,7 @@ void openFileActivityView_iOS(const iString *path);

iBool isPhone_iOS (void);

void safeAreaInsets_iOS (float *left, float *top, float *right, float *bottom);

int displayRefreshRate_iOS (void);

+float displayScale_iOS (const iWindow *window);



/----------------------------------------------------------------------------------------------/



diff --git a/src/ios.m b/src/ios.m

index a463230a..08c13660 100644

--- a/src/ios.m

+++ b/src/ios.m

@@ -43,7 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */

static iBool isSystemDarkMode_ = iFalse;

static iBool isPhone_ = iFalse;



-static UIWindow *uiWindow_(iWindow *window) {

+static UIWindow *uiWindow_(const iWindow *window) {

 SDL_SysWMinfo wm;

 SDL_VERSION(&wm.version);

 if (SDL_GetWindowWMInfo(window->win, &wm)) {

@@ -540,6 +540,10 @@ int displayRefreshRate_iOS(void) {

 return (int) uiWindow_(get_Window()).screen.maximumFramesPerSecond;

}



+float displayScale_iOS(const iWindow *window) {

+ return uiWindow_(window).screen.scale;

+}

+

void setupWindow_iOS(iWindow *window) {

 UIViewController *ctl = viewController_(window);

 isSystemDarkMode_ = isDarkMode_(window);

diff --git a/src/ui/window.c b/src/ui/window.c

index 2b4e3835..9c462c0c 100644

--- a/src/ui/window.c

+++ b/src/ui/window.c

@@ -376,10 +376,14 @@ void drawWhileResizing_MainWindow(iMainWindow *d, int w, int h) {

}



static float pixelRatio_Window_(const iWindow *d) {

+#if defined (iPlatformAppleMobile)

+ return displayScale_iOS(d);

+#else

 int dx, x;

 SDL_GetRendererOutputSize(d->render, &dx, NULL);

 SDL_GetWindowSize(d->win, &x, NULL);

 return (float) dx / (float) x;

+#endif

}



#if defined (iPlatformApple)

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.15/pcdiff/80e59939ece01707de32b4f7ee6c54a35e773c9e
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
66.816891 milliseconds
Gemini-to-HTML Time
1.055317 milliseconds

This content has been proxied by September (ba2dc).