Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed hard-coded list indents (now -webkit-padding-start is used)

  • Loading branch information...
commit cf6a447cdc27703df7231749260cf7722c43e9c2 1 parent 54bdbf9
@Cocoanetics authored
View
9 Core/Source/DTCoreTextParagraphStyle.m
@@ -10,13 +10,6 @@
static NSCache *_paragraphStyleCache;
-// use smaller list indent on iPhone OS
-#if TARGET_OS_IPHONE
-#define SPECIAL_LIST_INDENT 27.0f
-#else
-#define SPECIAL_LIST_INDENT 36.0f
-#endif
-
static dispatch_semaphore_t selfLock;
@implementation DTCoreTextParagraphStyle
@@ -102,7 +95,7 @@ - (id)init
minimumLineHeight = 0.0;
maximumLineHeight = 0.0;
paragraphSpacing = 0.0;
- listIndent = SPECIAL_LIST_INDENT;
+ listIndent = 0;
}
return self;
View
5 Core/Source/NSAttributedString+DTCoreText.h
@@ -105,11 +105,10 @@
@param listCounter The value for the list item.
@param listStyle The list style
+ @param listIndent The amount in px to indent the list
@param attributes The attribute dictionary for the text to be prefixed
@returns An attributed string with the list prefix
*/
-+ (NSAttributedString *)prefixForListItemWithCounter:(NSUInteger)listCounter listStyle:(DTCSSListStyle *)listStyle attributes:(NSDictionary *)attributes;
-
-
++ (NSAttributedString *)prefixForListItemWithCounter:(NSUInteger)listCounter listStyle:(DTCSSListStyle *)listStyle listIndent:(CGFloat)listIndent attributes:(NSDictionary *)attributes;
@end
View
11 Core/Source/NSAttributedString+DTCoreText.m
@@ -9,13 +9,6 @@
#import "DTCoreText.h"
#import "NSAttributedString+DTCoreText.h"
-// use smaller list indent on iPhone OS
-#if TARGET_OS_IPHONE
-#define SPECIAL_LIST_INDENT 27.0f
-#else
-#define SPECIAL_LIST_INDENT 36.0f
-#endif
-
@implementation NSAttributedString (DTCoreText)
#pragma mark Text Attachments
@@ -756,7 +749,7 @@ - (NSString *)plainTextString
}
#pragma Generating Special Attributed Strings
-+ (NSAttributedString *)prefixForListItemWithCounter:(NSUInteger)listCounter listStyle:(DTCSSListStyle *)listStyle attributes:(NSDictionary *)attributes
++ (NSAttributedString *)prefixForListItemWithCounter:(NSUInteger)listCounter listStyle:(DTCSSListStyle *)listStyle listIndent:(CGFloat)listIndent attributes:(NSDictionary *)attributes
{
// get existing values from attributes
CTParagraphStyleRef paraStyle = (__bridge CTParagraphStyleRef)[attributes objectForKey:(id)kCTParagraphStyleAttributeName];
@@ -772,7 +765,7 @@ + (NSAttributedString *)prefixForListItemWithCounter:(NSUInteger)listCounter lis
paragraphStyle.tabStops = nil;
- paragraphStyle.headIndent = SPECIAL_LIST_INDENT;
+ paragraphStyle.headIndent = listIndent;
paragraphStyle.paragraphSpacing = 0;
// first tab is to right-align bullet, numbering against
Please sign in to comment.
Something went wrong with that request. Please try again.