Closed BretJohnson closed 2 years ago
@gitbot backport main
Backport Job to branch main Created! The magic is happening here
Hooray! Backport succeeded! Please see https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5799997 for more details.
With the macos P13 API type changes, an issue was introduced since casting an ObjCRuntime.nfloat to an nint (aka IntPtr) doesn't work properly - (nint)(ObjCRuntime.nfloat)23 for instance will evaluate to 0x4037000000000000, the floating point bits are just reinterpreted as an int rather than actually being converted.
That in turn caused huge sizes for width and height causing new CGBitmapContext to throw an exception.
Adding the double cast here fixes this, for now.
Soon ObjCRuntime.nfloat will go away, replaced by System.Runtime.InteropServices.NFloat, but for now this workaround makes us work.
Fixes: AB#1487089 AB#1487070 AB#1487047