Source/GGBTextLayer.m
changeset 10 6c78cc6bd7a6
parent 9 a59acc683080
     1.1 --- a/Source/GGBTextLayer.m	Thu May 29 15:04:06 2008 -0700
     1.2 +++ b/Source/GGBTextLayer.m	Thu Jul 03 17:44:30 2008 -0700
     1.3 @@ -51,13 +51,17 @@
     1.4      label.foregroundColor = kBlackColor;
     1.5      
     1.6      NSString *mode;
     1.7 -    if( align & kCALayerWidthSizable )
     1.8 +    if( (align & (kCALayerMinXMargin | kCALayerMaxXMargin)) == (kCALayerMinXMargin | kCALayerMaxXMargin) )
     1.9          mode = @"center";
    1.10 -    else if( align & kCALayerMinXMargin )
    1.11 -        mode = @"right";
    1.12 -    else
    1.13 -        mode = @"left";
    1.14 -    align |= kCALayerWidthSizable;
    1.15 +    else {
    1.16 +        if( align & kCALayerWidthSizable )
    1.17 +            mode = @"center";
    1.18 +        else if( align & kCALayerMinXMargin )
    1.19 +            mode = @"right";
    1.20 +        else
    1.21 +            mode = @"left";
    1.22 +        align |= kCALayerWidthSizable;
    1.23 +    }
    1.24      label.alignmentMode = mode;
    1.25      
    1.26      // Get the bounds of the interior of the superlayer: