Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
build/
DerivedData
.DS_Store
._*

## Various settings
*.pbxuser
Expand Down
4 changes: 2 additions & 2 deletions iosMath/render/MTConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// TARGET_OS_MAC is defined as 1 for both Mac OS and iOS,
// so TARGET_OS_IPHONE is reliable.
@import UIKit;
#import "UIColor+HexString.h"
#import "UIColor+iosMathHexString.h"

typedef UIView MTView;
typedef UIColor MTColor;
Expand All @@ -32,7 +32,7 @@ typedef CGRect MTRect;
@import AppKit;
#import "NSBezierPath+addLineToPoint.h"
#import "NSView+backgroundColor.h"
#import "NSColor+HexString.h"
#import "NSColor+iosMathHexString.h"
#import "MTLabel.h"

typedef NSView MTView;
Expand Down
19 changes: 0 additions & 19 deletions iosMath/render/NSColor+HexString.h

This file was deleted.

13 changes: 13 additions & 0 deletions iosMath/render/NSColor+iosMathHexString.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@


#include <TargetConditionals.h>

#if !TARGET_OS_IPHONE
#import <Cocoa/Cocoa.h>

@interface NSColor (iosMathHexString)

+ (NSColor *)iosMathColorFromHexString:(NSString *)hexString;

@end
#endif
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
//
// NSColor+HexString.m
// iosMath
//
// Created by Markus Sähn on 21/03/2017.
//
//

#import "NSColor+HexString.h"
#import "NSColor+iosMathHexString.h"

#if !TARGET_OS_IPHONE
@implementation NSColor (HexString)
@implementation NSColor (iosMathHexString)

+ (NSColor *)colorFromHexString:(NSString *)hexString {
+ (NSColor *)iosMathColorFromHexString:(NSString *)hexString {
if ([hexString isEqualToString:@""]) {
return nil;
}
Expand Down
16 changes: 0 additions & 16 deletions iosMath/render/UIColor+HexString.h

This file was deleted.

10 changes: 10 additions & 0 deletions iosMath/render/UIColor+iosMathHexString.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@


#if TARGET_OS_IPHONE

@interface UIColor (iosMathHexString)

+ (UIColor *)iosMathColorFromHexString:(NSString *)hexString;

@end
#endif
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
//
// UIColor+HexString.m
// iosMath
//
// Created by Markus Sähn on 21/03/2017.
//
//

#import "UIColor+HexString.h"

#import "UIColor+iosMathHexString.h"

#if TARGET_OS_IPHONE

@implementation UIColor (HexString)
@implementation UIColor (iosMathHexString)

+ (UIColor *)colorFromHexString:(NSString *)hexString {
+ (UIColor *)iosMathColorFromHexString:(NSString *)hexString {
if ([hexString isEqualToString:@""]) {
return nil;
}
Expand Down
4 changes: 2 additions & 2 deletions iosMath/render/internal/MTTypesetter.m
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ - (void) createDisplayAtoms:(NSArray*) preprocessed
}
MTMathColor* colorAtom = (MTMathColor*) atom;
MTDisplay* display = [MTTypesetter createLineForMathList:colorAtom.innerList font:_font style:_style];
display.localTextColor = [MTColor colorFromHexString:colorAtom.colorString];
display.localTextColor = [MTColor iosMathColorFromHexString:colorAtom.colorString];
display.position = _currentPosition;
_currentPosition.x += display.width;
[_displayAtoms addObject:display];
Expand All @@ -638,7 +638,7 @@ - (void) createDisplayAtoms:(NSArray*) preprocessed
MTMathColorbox* colorboxAtom = (MTMathColorbox*) atom;
MTDisplay* display = [MTTypesetter createLineForMathList:colorboxAtom.innerList font:_font style:_style];

display.localBackgroundColor = [MTColor colorFromHexString:colorboxAtom.colorString];
display.localBackgroundColor = [MTColor iosMathColorFromHexString:colorboxAtom.colorString];
display.position = _currentPosition;
_currentPosition.x += display.width;
[_displayAtoms addObject:display];
Expand Down