Default the text position point to (0,0) if it's undefined.

This commit is contained in:
Randall Luecke committed 2011-06-18 21:53:50 -07:00
1 parent c942259c90
commit f4f4dd8025
2 files changed
+10 -1

No files matched your search

+1 -1
View File
@@ -37,7 +37,7 @@ function CGContextSetTextMatrix(/* CGContext */ aContext, /* CGAffineTransform *
function CGContextGetTextPosition(/* CGContext */ aContext)
{
return aContext._textPosition;
return aContext._textPosition || _CGPointMakeZero();
}
function CGContextSetTextPosition(/* CGContext */ aContext, /* float */ x, /* float */ y)
+9
View File
@@ -27,6 +27,10 @@
@import "CPRange.j"
@import "CPString.j"
CPFontAttributeName = "font";
CPForegroundColorAttributeName = "color";
/*!
@class CPAttributedString
@ingroup foundation
@@ -42,6 +46,11 @@
implements functionality from both NSAttributedString and
NSMutableAttributedString. However, to ease converting of existing
Objective-C code a CPMutableAttributedString alias to this class exists.
Below are a list of commonly used attributes:
CPFontAttributeName - Font object
CPForegroundColorAttributeName - CPColor object
*/
@implementation CPAttributedString : CPObject
{