Skip to content

Instantly share code, notes, and snippets.

@gnovos
Forked from basecode/CGGeometry+Additions.h
Created August 3, 2012 20:37
Show Gist options
  • Save gnovos/3251304 to your computer and use it in GitHub Desktop.
Save gnovos/3251304 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