cbd0d5192d
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 :-)
40 lines
924 B
Objective-C
40 lines
924 B
Objective-C
//
|
|
// IJSVGCommandHorizontalLine.m
|
|
// IconJar
|
|
//
|
|
// Created by Curtis Hard on 30/08/2014.
|
|
// Copyright (c) 2014 Curtis Hard. All rights reserved.
|
|
//
|
|
|
|
#import "IJSVGCommandHorizontalLine.h"
|
|
|
|
@implementation IJSVGCommandHorizontalLine
|
|
|
|
+ (void)load
|
|
{
|
|
[IJSVGCommand registerClass:[self class]
|
|
forCommand:@"h"];
|
|
}
|
|
|
|
+ (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( params[0], [path currentSubpath].currentPoint.y)];
|
|
return;
|
|
}
|
|
[[path currentSubpath] relativeLineToPoint:NSMakePoint( params[0], 0.f)];
|
|
}
|
|
|
|
@end
|