This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (CGPathRef)newPathForRoundedRect:(CGRect)rect | |
radius:(CGFloat)radius | |
{ | |
CGMutablePathRef result = CGPathCreateMutable(); | |
CGRect innerRect = CGRectInset(rect, radius, radius); | |
CGFloat inside_right = innerRect.origin.x + innerRect.size.width; | |
CGFloat outside_right = rect.origin.x + rect.size.width; | |
CGFloat inside_bottom = innerRect.origin.y + innerRect.size.height; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)updateResolution { | |
//LogMethod(); | |
isdblTapZooming = NO; | |
float zoomScale = [self zoomScale]; | |
CGSize oldContentViewSize = [contentView frame].size; | |
//zooming properly resets contentsize as it happens. | |
CGSize newContentSize = [self contentSize]; | |
CGPoint newContentOffset = [self contentOffset]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replace @synthesize offscreenContext with this code: | |
-(CGContextRef )offscreenContext | |
{ | |
return offscreenContext; | |
} | |
-(void)setOffscreenContext:(CGContextRef)anotherOffscreenContext | |
{ | |
if (offscreenContext != anotherOffscreenContext) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toIO | |
duration:(NSTimeInterval)duration | |
{ | |
CGFloat angle = 0; | |
switch (toIO) { | |
case UIInterfaceOrientationPortrait: | |
angle = 0; | |
break; | |
case UIInterfaceOrientationPortraitUpsideDown: | |
angle = M_PI; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)motionBegan:(UIEventSubtype)motion | |
withEvent:(UIEvent *)event | |
{ | |
#define STRINGIFY(js) #js | |
NSString *js = @ STRINGIFY( | |
var $elements = $('.leftArea_container>div'), | |
$rand = $elements.not(':first').eq(Math.floor(Math.random() * $elements.length)); | |
$rand.slideUp(500,function(){ $(this).insertBefore($elements.first()); }).slideDown(); | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// three xyz coordinates, three normal coordinates, two texture coordinates * | |
// six vertices per face * | |
// six faces per cube | |
GLfloat gCubeVertexData[(3 + 3 + 2) * 6 * 6] = | |
{ | |
// Data layout for each line below is: | |
// positionX, positionY, positionZ, normalX, normalY, normalZ, texCoord0S, texCoord0T, | |
0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, | |
0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, | |
0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setAsRotation(GLfloat m[16], GLfloat angle, GLfloat ax, GLfloat ay, GLfloat az) | |
{ | |
// Start with something valid | |
setAsIdentity(m); | |
// Normalize axis if necessary | |
GLfloat axisLength = sqrtf(ax*ax + ay*ay + az*az); | |
if (axisLength == 0.0f) return ; | |
ax /= axisLength; | |
ay /= axisLength; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BNRPerson.h | |
// SalesReport | |
// | |
// Created by Jonathan Blocksom on 4/1/13. | |
// Copyright (c) 2013 Jonathan Blocksom. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GLfloat vertices[] = { | |
// left side | |
-1.0, -1.0, -1.0, | |
-1.0, -1.0, 1.0, | |
-1.0, 1.0, -1.0, | |
-1.0, -1.0, 1.0, | |
-1.0, 1.0, -1.0, | |
-1.0, 1.0, 1.0, | |
// right side | |
1.0, -1.0, -1.0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GLuint cubeTriIndicesBottomTop[] = { | |
// Bottom | |
0, 1, 2, 0, 2, 3, | |
// Top | |
4, 5, 6, 4, 6, 7, | |
}; | |
GLuint cubeTriIndicesFrontBack[] = { | |
// Front | |
0, 4, 1, 4, 1, 5, |
OlderNewer