Skip to content

Commit

Permalink
Tweak things for Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
stevestreza committed Jan 19, 2011
1 parent 9d70c00 commit 2d3fe76
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
1 change: 0 additions & 1 deletion Source/NSImage+ContentMode.h
Expand Up @@ -6,7 +6,6 @@
// Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "VSGlobal.h"
#import "VSGlobal.h"

#if !TARGET_OS_IPHONE
Expand Down
12 changes: 9 additions & 3 deletions Source/NSImage+ContentMode.m
Expand Up @@ -8,8 +8,12 @@

#import "NSImage+ContentMode.h"

#if !TARGET_OS_IPHONE

#if TARGET_OS_IPHONE
@implementation UIImage (ContentMode)
#else
@implementation NSImage (ContentMode)
#endif

///////////////////////////////////////////////////////////////////////////////////////////////////
// private
Expand Down Expand Up @@ -123,10 +127,14 @@ - (void)drawInRect:(CGRect)rect contentMode:(UIViewContentMode)contentMode {

// [self drawInRect:rect];
//TODO expose the operation and fraction values, in Mac only
#if TARGET_OS_IPHONE
[self drawInRect:rect blendMode:kCGBlendModeNormal alpha:1.0];
#else
[self drawInRect:NSRectFromCGRect(rect)
fromRect:NSMakeRect(0, 0, self.size.width, self.size.height)
operation:NSCompositeSourceOver
fraction:1.0];
#endif

if (clip) {
CGContextRestoreGState(context);
Expand All @@ -151,5 +159,3 @@ - (void)drawInRect:(CGRect)rect radius:(CGFloat)radius contentMode:(UIViewConten
}

@end

#endif
17 changes: 12 additions & 5 deletions Source/VillainousStyle.xcodeproj/project.pbxproj
Expand Up @@ -366,7 +366,7 @@
1E0FDD1C10184B86007AFA92 /* VSMaskStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VSMaskStyle.m; sourceTree = "<group>"; };
1E0FDD2410184C18007AFA92 /* NSImage+CGImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSImage+CGImage.h"; sourceTree = "<group>"; };
1E0FDD2510184C18007AFA92 /* NSImage+CGImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSImage+CGImage.m"; sourceTree = "<group>"; };
1E0FDD5B101A79DF007AFA92 /* VillainousStyle.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = VillainousStyle.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1E0FDD5B101A79DF007AFA92 /* VillainousStyle */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.framework; path = VillainousStyle; sourceTree = BUILT_PRODUCTS_DIR; };
1E0FDD5C101A79DF007AFA92 /* VillainousStyle-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "VillainousStyle-Info.plist"; sourceTree = "<group>"; };
1E23702610CB42F000A03525 /* CALayer+VSStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CALayer+VSStyle.h"; sourceTree = "<group>"; };
1E23702710CB42F000A03525 /* CALayer+VSStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CALayer+VSStyle.m"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -501,7 +501,7 @@
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
1E0FDD5B101A79DF007AFA92 /* VillainousStyle.framework */,
1E0FDD5B101A79DF007AFA92 /* VillainousStyle */,
1E3123CB10AD256C00D72994 /* libVillainousStyle.a */,
1E5CFFBA10ED61E600B7B095 /* libVillainousStyle.a */,
);
Expand Down Expand Up @@ -743,7 +743,7 @@
);
name = VillainousStyle.framework;
productName = TTStyle;
productReference = 1E0FDD5B101A79DF007AFA92 /* VillainousStyle.framework */;
productReference = 1E0FDD5B101A79DF007AFA92 /* VillainousStyle */;
productType = "com.apple.product-type.framework";
};
1E3123CA10AD256C00D72994 /* libVillainousStyle.a - iPhone */ = {
Expand Down Expand Up @@ -788,7 +788,14 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "VillainousStyle" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* TTStyleMacTest */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -1033,7 +1040,7 @@
GCC_OPTIMIZATION_LEVEL = 0;
PREBINDING = NO;
PRODUCT_NAME = VillainousStyle;
SDKROOT = iphoneos4.0;
SDKROOT = iphoneos;
};
name = Debug;
};
Expand All @@ -1048,7 +1055,7 @@
GCC_ENABLE_FIX_AND_CONTINUE = NO;
PREBINDING = NO;
PRODUCT_NAME = VillainousStyle;
SDKROOT = iphoneos4.0;
SDKROOT = iphoneos;
ZERO_LINK = NO;
};
name = Release;
Expand Down

0 comments on commit 2d3fe76

Please sign in to comment.