Files
IJSVG/source/IJSVGCommandVerticalLine.m
T
Curtis Hard cbd0d5192d Fairly big update, read description...
This change includes various error handling methods on all relevant object initializers - also rewrote how we parse floats from strings, this seems to be about 2x quicker at parsing SVG's then it was previously :-)
2015-09-17 22:37:36 +01:00

40 lines
918 B
Objective-C

//
// IJSVGCommandVerticalLine.m
// IconJar
//
// Created by Curtis Hard on 30/08/2014.
// Copyright (c) 2014 Curtis Hard. All rights reserved.
//
#import "IJSVGCommandVerticalLine.h"
@implementation IJSVGCommandVerticalLine
+ (void)load
{
[IJSVGCommand registerClass:[self class]
forCommand:@"v"];
}
+ (NSInteger)requiredParameterCount
{
return 1;
}
+ (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( [path currentSubpath].currentPoint.x, params[0])];
return;
}
[[path currentSubpath] relativeLineToPoint:NSMakePoint( 0.f, params[0])];
}
@end