ffi 1.27: uikit_read_screen_scale via #objc_call
Third Phase 1D cluster. `UIScreen.mainScreen.nativeScale` chain reads through `#objc_call(*void)` + `#objc_call(f64)`. First standalone `#objc_call(f64)` exercise — `f64` returns had only been covered indirectly by the 4×f64 UIEdgeInsets HFA path. Net -4 lines. iOS-sim chess regression smoke: sharp text rendering + accurate touch hit-testing both confirm `plat.dpi_scale` is being populated correctly through the new path.
This commit is contained in:
@@ -343,13 +343,9 @@ uikit_register_classes :: () {
|
||||
// (that's where the gles path picks the scale up).
|
||||
uikit_read_screen_scale :: (plat: *UIKitPlatform) {
|
||||
inline if OS != .ios { return; }
|
||||
UIScreen := objc_getClass("UIScreen".ptr);
|
||||
sel_main_screen := sel_registerName("mainScreen".ptr);
|
||||
sel_native_scale := sel_registerName("nativeScale".ptr);
|
||||
msg_o : (*void, *void) -> *void = xx objc_msgSend;
|
||||
msg_d : (*void, *void) -> f64 = xx objc_msgSend;
|
||||
screen := msg_o(UIScreen, sel_main_screen);
|
||||
scale_d : f64 = msg_d(screen, sel_native_scale);
|
||||
UIScreen := objc_getClass("UIScreen".ptr);
|
||||
screen := #objc_call(*void)(UIScreen, "mainScreen");
|
||||
scale_d := #objc_call(f64)(screen, "nativeScale");
|
||||
plat.dpi_scale = xx scale_d;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user