Skip to content

Instantly share code, notes, and snippets.

@basecode
Created July 19, 2012 19:11
Show Gist options
  • Save basecode/3146086 to your computer and use it in GitHub Desktop.
Save basecode/3146086 to your computer and use it in GitHub Desktop.
CGGeometry+Additions
// CGGeometry+Additions.h
// Copyright (c) 2012 Tobias Reiss (MIT License)
#import <CoreGraphics/CGGeometry.h>
CG_INLINE CGRect CGRectScale(CGRect rect, CGFloat mult) {
CGPoint origin = rect.origin;
CGSize size = rect.size;
return CGRectMake(origin.x * mult, origin.y * mult, size.width * mult, size.height * mult);
}
CG_INLINE CGSize CGSizeScale(CGSize size, CGFloat mult) {
return CGSizeMake(size.width * mult, size.height * mult);
}
// CGGeometry+Additions.m
// Copyright (c) 2012 Tobias Reiss (MIT License)
#import "CGGeometry+Additions.h"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment