Changeset 347

Show
Ignore:
Timestamp:
03/24/07 00:42:04 (1 year ago)
Author:
cweider2
Message:

RenderView: On further consideration, line wraps to current frame, not previous

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/LaserLine_2.0/Src/Interface/LZRenderedFrameView.m

    r337 r347  
    5151  RawPoint *points = (RawPoint *)[rawFrameData bytes]; 
    5252   
    53   //draw line from the last fame's last point to this frame's first 
    54   if(count > 0) 
    55         { 
    56         [curve removeAllPoints]; 
    57         NSPoint point1 = NSMakePoint(lastPoint.x, lastPoint.y); 
    58         NSPoint point2 = NSMakePoint(points[0].x, points[0].y); 
    59          
    60         if(lastPoint.r | lastPoint.g | lastPoint.b)     //only do curve if color is non-zero 
    61                 { 
    62                 [curve moveToPoint:point1]; 
    63                 [curve lineToPoint:point2]; 
    64                  
    65                 [curve transformUsingAffineTransform:transform]; 
    66                  
    67                 NSColor *laserColor = [NSColor colorWithCalibratedRed:(lastPoint.r/255.) green:(lastPoint.g/255.) blue:(lastPoint.b)/255. alpha:1]; 
    68                  
    69                 [curve setLineWidth:400*scalingFactor]; 
    70                 [[laserColor colorWithAlphaComponent:.5] set]; 
    71                 [curve stroke]; 
    72                  
    73                 [curve setLineWidth:200*scalingFactor]; 
    74                 [laserColor set]; 
    75                 [curve stroke]; 
    76                 } 
    77         } 
    78    
    79   for(i; i < count-1; i++) 
     53  for(i; i < count; i++) 
    8054        { 
    8155        [curve removeAllPoints]; 
    8256        NSPoint point1 = NSMakePoint(points[i].x, points[i].y); 
    83         NSPoint point2 = NSMakePoint(points[i+1].x, points[i+1].y); 
     57        NSPoint point2 = NSMakePoint(points[(i+1)%count].x, points[(i+1)%count].y); 
    8458         
    8559        if(points[i].r | points[i].g | points[i].b)     //only do curve if color is non-zero