Ignore:
Timestamp:
12/08/07 06:07:14 (16 years ago)
Author:
Nicholas Riley
Message:

Apparently in Xcode, 'Commit Entire Project' doesn't. See the log message from [369].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cocoa/AntiRSI/CTBadge/CTGradient.m

    r332 r370  
    779779- (void)setBlendingMode:(CTGradientBlendingMode)mode;
    780780  {
    781   blendingMode = mode;
    782  
    783781  //Choose what blending function to use
    784782  void *evaluationFunction;
    785   switch(blendingMode)
     783  switch(mode)
    786784        {
    787785        case CTLinearBlendingMode:
     
    791789        case CTInverseChromaticBlendingMode:
    792790                 evaluationFunction = &inverseChromaticEvaluation;      break;
    793         }
    794  
     791        default:
     792                 NSParameterAssert("blending mode not supported" && NO);
     793                 return; // unreachable, satisfy compiler
     794        }
     795
     796  blendingMode = mode;
     797
    795798  //replace the current CoreGraphics Function with new one
    796799  if(gradientFunction != NULL)
     
    11831186
    11841187
    1185 void transformRGB_HSV(float *components) //H,S,B -> R,G,B
    1186         {
    1187         float H, S, V;
     1188void transformRGB_HSV(float *components) //H,S,B <- R,G,B
     1189        {
    11881190        float R = components[0],
    11891191                  G = components[1],
     
    11931195              MIN = R < G ? (R < B ? R : B) : (G < B ? G : B);
    11941196       
    1195         if(MAX == MIN)
    1196                 H = NAN;
    1197         else if(MAX == R)
    1198                 if(G >= B)
    1199                         H = 60*(G-B)/(MAX-MIN)+0;
    1200                 else
    1201                         H = 60*(G-B)/(MAX-MIN)+360;
    1202         else if(MAX == G)
    1203                 H = 60*(B-R)/(MAX-MIN)+120;
    1204         else if(MAX == B)
    1205                 H = 60*(R-G)/(MAX-MIN)+240;
    1206        
    1207         S = MAX == 0 ? 0 : 1 - MIN/MAX;
    1208         V = MAX;
     1197        float H = NAN;
     1198
     1199        if(MAX != MIN)
     1200          {
     1201          if(MAX == R)
     1202                  if(G >= B)
     1203                          H = 60*(G-B)/(MAX-MIN)+0;
     1204                  else
     1205                          H = 60*(G-B)/(MAX-MIN)+360;
     1206          else if(MAX == G)
     1207                  H = 60*(B-R)/(MAX-MIN)+120;
     1208          else if(MAX == B)
     1209                  H = 60*(R-G)/(MAX-MIN)+240;
     1210          }
     1211       
     1212        float S = MAX == 0 ? 0 : 1 - MIN/MAX;
     1213        float V = MAX;
    12091214       
    12101215        components[0] = H;
     
    12341239                case 4: R=t;G=p;B=V;    break;
    12351240                case 5: R=V;G=p;B=q;    break;
     1241                default: R=0;G=0;B=0;   // unreachable, satisfy compiler
    12361242                }
    12371243       
Note: See TracChangeset for help on using the changeset viewer.