From 982a9be5d39fb042e1deb86af5930cb54729f83f Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 15 Dec 2013 10:46:39 +1100 Subject: Format normalization - whitespace and braces made consistent. Parameter names added to method declarations. --- cocoa/QuartzTextLayout.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'cocoa/QuartzTextLayout.h') diff --git a/cocoa/QuartzTextLayout.h b/cocoa/QuartzTextLayout.h index c789ed10f..edf357682 100644 --- a/cocoa/QuartzTextLayout.h +++ b/cocoa/QuartzTextLayout.h @@ -39,7 +39,7 @@ public: { CFRelease(mLine); mLine = NULL; - } + } } inline void setText( const UInt8* buffer, size_t byteLength, CFStringEncoding encoding, const QuartzTextStyle& r ) @@ -47,19 +47,19 @@ public: CFStringRef str = CFStringCreateWithBytes( NULL, buffer, byteLength, encoding, false ); if (!str) return; - + stringLength = CFStringGetLength(str); CFMutableDictionaryRef stringAttribs = r.getCTStyle(); - + if (mString != NULL) CFRelease(mString); mString = ::CFAttributedStringCreate(NULL, str, stringAttribs); - + if (mLine != NULL) CFRelease(mLine); mLine = ::CTLineCreateWithAttributedString(mString); - + CFRelease( str ); } @@ -70,28 +70,28 @@ public: { if (mLine == NULL) return; - + ::CGContextSetTextMatrix(gc, CGAffineTransformMakeScale(1.0, -1.0)); - + // Set the text drawing position. ::CGContextSetTextPosition(gc, x, y); - + // And finally, draw! ::CTLineDraw(mLine, gc); } - + float MeasureStringWidth() - { + { if (mLine == NULL) return 0.0f; - + return ::CTLineGetTypographicBounds(mLine, NULL, NULL, NULL); } - + CTLineRef getCTLine() { return mLine; } - + CFIndex getStringLength() { return stringLength; } -- cgit v1.2.3