Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 8 fixes #34

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 52 additions & 41 deletions Brushes-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,27 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<string>Brushes Redux</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Brushes Painting</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<key>CFBundleTypeIconFiles</key>
<array>
<string>com.taptrix.brushes</string>
<string>Icon-64x64</string>
<string>export_brushes_icon-modern@2x</string>
<string>Icon-64x64</string>
<string>Icon-320x320</string>
<string>export_brushes_icon-modern@2x</string>
</array>
</dict>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string>Brushes Painting (unpacked)</string>
<string>Brushes Redux Painting</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.taptrix.brushes-unpacked</string>
<string>dk.holi.brushes-dev.packed</string>
</array>
</dict>
</array>
Expand Down Expand Up @@ -66,38 +60,68 @@
<string>AppIcon72x72</string>
<string>AppIcon60x60</string>
<string>AppIcon57x57</string>
<string>AppIcon167x167</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
</dict>
<key>CFBundleIdentifier</key>
<string>com.taptrix.brushes</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.1</string>
<string>3.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>db-eifwy4o38a0ks52</string>
<string>db-dsg0cjnlajumkzq</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>3.1</string>
<string>3.2</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string></string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>Crashlytics</string>
</dict>
</array>
</dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>dbapi-2</string>
<string>dbapi-8-emm</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
<string>MainWindow</string>
<key>UIAppFonts</key>
<array>
<string>MaterialDesignIcons.ttf</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIStatusBarHidden</key>
<true/>
<key>UIStatusBarStyle</key>
Expand All @@ -124,32 +148,19 @@
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Brushes Painting</string>
<key>UTTypeIdentifier</key>
<string>com.taptrix.brushes</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>brushes</string>
<key>public.mime-type</key>
<string>application/x-brushes</string>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Brushes Painting (unpacked)</string>
<string>Brushes Redux Painting</string>
<key>UTTypeIdentifier</key>
<string>com.taptrix.brushes-unpacked</string>
<string>dk.holi.brushes-dev.packed</string>
<key>UTTypeSize320IconFile</key>
<string>Icon-320x320</string>
<key>UTTypeSize64IconFile</key>
<string>Icon-64x64</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>brushes_unpacked</string>
<key>public.mime-type</key>
<string>application/x-brushes-unpacked</string>
<array>
<string>brushes</string>
</array>
</dict>
</dict>
</array>
Expand Down
138 changes: 94 additions & 44 deletions Brushes.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion Classes/WDActivityController.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ - (void) loadView
table.dataSource = activityManager;
table.allowsSelection = NO;

self.contentSizeForViewInPopover = table.frame.size;
if ([self respondsToSelector:@selector(setPreferredContentSize:)])
self.preferredContentSize = table.frame.size;
else
self.contentSizeForViewInPopover = table.frame.size;


if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
UIBarButtonItem *doneItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
Expand Down
5 changes: 4 additions & 1 deletion Classes/WDAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import "WDPaintingSizeController.h"
#import "WDDocument.h"
#import "WDStylusManager.h"
//#import <Crashlytics/Crashlytics.h>

NSString *WDDropboxWasUnlinkedNotification = @"WDDropboxWasUnlinkedNotification";

Expand Down Expand Up @@ -49,12 +50,14 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application
NSString *appKey = @"xxxx";
NSString *appSecret = @"xxxx";

DBSession *session = [[DBSession alloc] initWithAppKey:appKey appSecret:appSecret root:kDBRootDropbox];
DBSession *session = [[DBSession alloc] initWithAppKey:appKey appSecret:appSecret root:kDBRootAppFolder];
session.delegate = self; // DBSessionDelegate methods allow you to handle re-authenticating
[DBSession setSharedSession:session];

[self setupDefaults];

//[Crashlytics startWithAPIKey:@"xxxx"];

browserController = [[WDBrowserController alloc] initWithNibName:nil bundle:nil];
navigationController = [[UINavigationController alloc] initWithRootViewController:browserController];

Expand Down
1 change: 1 addition & 0 deletions Classes/WDBezierSegment.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#import <Foundation/Foundation.h>

extern const float kDefaultFlatness;
extern unsigned long long BezierSegmentRecusionCounter;

@class WDBezierNode;
@class WD3DPoint;
Expand Down
31 changes: 31 additions & 0 deletions Classes/WDBezierSegment.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
#import "WD3DPoint.h"
#import "WDBezierSegment.h"
#import "WDBezierNode.h"
#import <Crashlytics/Crashlytics.h>
#import "WDActiveState.h"
#import "WDBrush.h"
#import "WDTool.h"

const float kDefaultFlatness = 1;
unsigned long long BezierSegmentRecusionCounter;

@implementation WDBezierSegment

Expand Down Expand Up @@ -101,6 +106,32 @@ - (WD3DPoint *) splitAtT:(float)t left:(WDBezierSegment **)L right:(WDBezierSegm

- (void) flattenIntoArray:(NSMutableArray *)points
{
// Debug comming up

if (BezierSegmentRecusionCounter > 100)
CLSNSLog(@"BezierSegmentRecusionCounter > 100");

if (BezierSegmentRecusionCounter > 200)
CLSNSLog(@"BezierSegmentRecusionCounter > 200");

if (BezierSegmentRecusionCounter > 300)
CLSNSLog(@"BezierSegmentRecusionCounter > 300");

if (BezierSegmentRecusionCounter > 400)
CLSNSLog(@"BezierSegmentRecusionCounter > 400");

if (BezierSegmentRecusionCounter > 500)
{
CLSNSLog(@"BezierSegmentRecusionCounter > 500 - bailing out of flattenIntoArray:");
CLSNSLog(@"Brushes count: %lu", (unsigned long)[WDActiveState sharedInstance].brushesCount);
CLSNSLog(@"Brush data: %@", [[WDActiveState sharedInstance].brush allProperties]);
CLSNSLog(@"Active tool (icon name): %@", [WDActiveState sharedInstance].activeTool.iconName);
CLSNSLog(@"Paint color: %@", [WDActiveState sharedInstance].paintColor);
return;
}

BezierSegmentRecusionCounter++;

if ([self isFlatWithTolerance:kDefaultFlatness]) {
if (points.count == 0) {
[points addObject:self.start];
Expand Down
7 changes: 6 additions & 1 deletion Classes/WDBrowserController.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
UIPopoverController *popoverController_;
UIBarButtonItem *selectItem_;
UIBarButtonItem *deleteItem_;
UIBarButtonItem *shareItem_;

NSMutableSet *selectedPaintings_;

Expand All @@ -56,15 +55,21 @@
@property (nonatomic, weak) UIViewController *currentPopoverViewController;
@property (nonatomic) UIActivityIndicatorView *activityIndicator;
@property (nonatomic) WDGridView *gridView;
@property (nonatomic) UIBarButtonItem *shareItem;

- (void) openDocument:(WDDocument *)document editing:(BOOL)editing;
- (void) showOpenFailure:(WDDocument *)document;

- (void) properlyEnableNavBarItems;

- (void) sharePaintings:(NSString *)format;
- (void) emailPaintings:(NSString *)format;
- (void) sendToDropbox:(NSString *)format;

- (void) createNewPainting:(CGSize)size;

- (void) showExportPanel:(id)sender;

- (void) showController:(UIViewController *)controller from:(id)sender;

@end
Loading