I have a problem with CATextLayer cleaning. and with iOS the solution is:
textLayer.contentsScale = UIScreen.mainScreen.scale
But I can't found "scale" property on cocoa NSScreen
Note: Answer with Object-C or Swift are OK.
[[NSScreen mainScreen] backingScaleFactor]
will give you the scaling factor for main display
I'm not sure it's the same as on iOS but NSScreen
has backingScaleFactor
, which might do the trick.
swift 4.2:
(NSScreen.main?.backingScaleFactor)!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With