diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2017-03-07 02:54:50 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2017-03-07 02:54:50 -0800 |
commit | 3a6f9c89e5edc675d5741eb5aa66e30e798fb3aa (patch) | |
tree | 5351106b223cc4885133730ed233e4fc41139761 /CyteKit/extern.h | |
parent | 2b5ceba288a3a3de4bceb6767953972b30f97f46 (diff) |
Split PackageListController partially for CyteKit.
Diffstat (limited to 'CyteKit/extern.h')
-rw-r--r-- | CyteKit/extern.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/CyteKit/extern.h b/CyteKit/extern.h index 670f560..562fb26 100644 --- a/CyteKit/extern.h +++ b/CyteKit/extern.h @@ -35,4 +35,24 @@ bool CyteIsReachable(const char *name); void CyteInitialize(NSString *app, NSString *version); +static inline double Retina(double value) { + value *= ScreenScale_; + value = round(value); + value /= ScreenScale_; + return value; +} + +static inline CGRect Retina(CGRect value) { + value.origin.x *= ScreenScale_; + value.origin.y *= ScreenScale_; + value.size.width *= ScreenScale_; + value.size.height *= ScreenScale_; + value = CGRectIntegral(value); + value.origin.x /= ScreenScale_; + value.origin.y /= ScreenScale_; + value.size.width /= ScreenScale_; + value.size.height /= ScreenScale_; + return value; +} + #endif//CyteKit_extern_H |