Changeset 6099


Ignore:
Timestamp:
Jun 9, 2008, 10:44:08 PM (15 years ago)
Author:
livings124
Message:

more adjustments to the pieces view

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/PiecesView.m

    r6098 r6099  
    2525#import "PiecesView.h"
    2626#import "InfoWindowController.h"
     27#import "CTGradient.h"
    2728
    2829#define MAX_ACROSS 18
     
    3334- (void) awakeFromNib
    3435{
    35         NSBezierPath * bp = [NSBezierPath bezierPathWithRect: [self bounds]];
    36        
    3736        //back image
    3837        fBack = [[NSImage alloc] initWithSize: [self bounds].size];
    3938       
    4039        [fBack lockFocus];
    41         [[NSColor colorWithCalibratedWhite: 0.0 alpha: 0.4] set];
    42         [bp fill];
     40        CTGradient * gradient = [CTGradient gradientWithBeginningColor: [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.4]
     41                                    endingColor: [NSColor colorWithCalibratedWhite: 0.25 alpha: 0.4]];
     42        [gradient fillRect: [self bounds] angle: 90.0];
    4343        [fBack unlockFocus];
    4444       
     
    144144    }
    145145   
    146     int i, j, piece, index = -1;
    147     float piecePercent;
     146    int i, j, index = -1;
    148147    NSRect rect = NSMakeRect(0, 0, fWidth, fWidth);
    149148   
     
    163162           
    164163            if (showAvailablity)
    165             {
    166                 piece = pieces[index];
    167                 if (piece < 0)
     164            {if (index==0) NSLog(@"%d", pieces[index]);
     165                int piece = pieces[index];
     166                if (piece == -1)
    168167                {
    169168                    if (first || fPieces[index] == -2)
     
    213212            }
    214213            else
    215             {
    216                 piecePercent = piecesPercent[index];
     214            {if (index==0) NSLog(@"%f", piecesPercent[index]);
     215                float piecePercent = piecesPercent[index];
    217216                if (piecePercent >= 1.0)
    218217                {
     
    229228                    else;
    230229                }
    231                 else if (piecePercent <= 0.0)
     230                else if (piecePercent == 0.0)
    232231                {
    233232                    if (first || fPieces[index] != 0)
Note: See TracChangeset for help on using the changeset viewer.