Skip to content
Browse files

Fixed #47 - handle empty strings for {fill,stroke}Text

  • Loading branch information...
1 parent 6968031 commit 9610f0258063cc90f0d41fcedac335446774f93c @phoboslab committed
Showing with 3 additions and 0 deletions.
  1. +3 −0 Classes/Ejecta/EJCanvas/EJFont.m
View
3 Classes/Ejecta/EJCanvas/EJFont.m
@@ -256,6 +256,7 @@ - (unsigned short)createGlyph:(CGGlyph)glyph {
}
- (void)drawString:(NSString*)string toContext:(EJCanvasContext*)context x:(float)x y:(float)y {
+ if( string.length == 0 ) { return; }
StringLayout layout = [self layoutForString:string];
@@ -340,6 +341,8 @@ - (void)drawString:(NSString*)string toContext:(EJCanvasContext*)context x:(floa
}
- (float)measureString:(NSString*)string {
+ if( string.length == 0 ) { return 0; }
+
float width;
[self layoutForString:string];

0 comments on commit 9610f02

Please sign in to comment.
Something went wrong with that request. Please try again.