Files
IJSVG/source/IJSVGCommandLineTo.m
T
Curtis Hard 4804fe4db3 Added elliptical arc command (finally)
Various other fixes and tweaks
2015-04-13 19:13:52 +01:00

42 lines
1008 B
Objective-C

//
// IJSVGCommandLineTo.m
// IconJar
//
// Created by Curtis Hard on 30/08/2014.
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import "IJSVGCommandLineTo.h"
@implementation IJSVGCommandLineTo
+ (void)load
{
[IJSVGCommand registerClass:[self class]
forCommand:@"l"];
}
+ (NSInteger)requiredParameterCount
{
return 2;
}
+ (void)runWithParams:(CGFloat *)params
paramCount:(NSInteger)count
command:(IJSVGCommand *)currentCommand
previousCommand:(IJSVGCommand *)command
type:(IJSVGCommandType)type
path:(IJSVGPath *)path
{
if( type == IJSVGCommandTypeAbsolute )
{
[[path currentSubpath] lineToPoint:NSMakePoint( params[0], params[1])];
return;
}
NSPoint point = NSMakePoint( [path currentSubpath].currentPoint.x + params[0],
[path currentSubpath].currentPoint.y + params[1]);
[[path currentSubpath] lineToPoint:point];
}
@end