Skip to content

Commit 0445511

Browse files
committed
improve landscapePopupSizeFix
1 parent 14f2326 commit 0445511

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Tweak.xm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,11 @@ IL2CPP::CClass* hooked_LiveMain_BasePopup_OpenAsync(void* self) {
529529
"UnityEngine.Screen",
530530
"get_height"
531531
);
532-
NSLog(@"[IL2CPP Tweak] Screen size: %f x %f", width, height);
533-
IL2CPP::CClass* pSelf = reinterpret_cast<IL2CPP::CClass*>(self);
534-
pSelf->CallMethodSafe<void>("SetLandscapeScaleIfNeed", fmin(width, height) / fmax(width, height));
532+
if (width > height) {
533+
// NSLog(@"[IL2CPP Tweak] Screen size: %f x %f", width, height);
534+
IL2CPP::CClass* pSelf = reinterpret_cast<IL2CPP::CClass*>(self);
535+
pSelf->CallMethodSafe<void>("SetLandscapeScaleIfNeed", height / width);
536+
}
535537
return original_LiveMain_BasePopup_OpenAsync(self);
536538
}
537539

0 commit comments

Comments
 (0)