Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes drawString / TextLayout bug discovered by diodo3 and a.stellato

  • Loading branch information...
commit fdcfd1a00d7b3761ec0f959c77c24fc81fec6ea0 1 parent 6aff3a8
@andrewfb andrewfb authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/cinder/Text.cpp
View
4 src/cinder/Text.cpp
@@ -183,7 +183,9 @@ void Line::calcExtents()
::CFAttributedStringBeginEditing( attrStr );
for( vector<Run>::const_iterator runIt = mRuns.begin(); runIt != mRuns.end(); ++runIt ) {
// create and append this run's CFAttributedString
- ::CFAttributedStringReplaceAttributedString( attrStr, ::CFRangeMake( ::CFAttributedStringGetLength( attrStr ), 0 ), cocoa::createCfAttributedString( runIt->mText, runIt->mFont, runIt->mColor ) );
+ ::CFAttributedStringRef runStr = cocoa::createCfAttributedString( runIt->mText, runIt->mFont, runIt->mColor );
+ ::CFAttributedStringReplaceAttributedString( attrStr, ::CFRangeMake( ::CFAttributedStringGetLength( attrStr ), 0 ), runStr );
+ ::CFRelease( runStr );
}
// all done - coalesce
::CFAttributedStringEndEditing( attrStr );
Please sign in to comment.
Something went wrong with that request. Please try again.