diff --git a/IJSVGExample/IJSVGExample.xcodeproj/project.xcworkspace/xcuserdata/curtishard.xcuserdatad/UserInterfaceState.xcuserstate b/IJSVGExample/IJSVGExample.xcodeproj/project.xcworkspace/xcuserdata/curtishard.xcuserdatad/UserInterfaceState.xcuserstate index 520c962..8332cd0 100644 Binary files a/IJSVGExample/IJSVGExample.xcodeproj/project.xcworkspace/xcuserdata/curtishard.xcuserdatad/UserInterfaceState.xcuserstate and b/IJSVGExample/IJSVGExample.xcodeproj/project.xcworkspace/xcuserdata/curtishard.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/IJSVGExample/IJSVGExample/home.svg b/IJSVGExample/IJSVGExample/home.svg index 34d1966..a872f55 100644 --- a/IJSVGExample/IJSVGExample/home.svg +++ b/IJSVGExample/IJSVGExample/home.svg @@ -1,336 +1,32 @@ - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/IJSVGLayerTree.m b/source/IJSVGLayerTree.m index 55f48af..b982fc4 100644 --- a/source/IJSVGLayerTree.m +++ b/source/IJSVGLayerTree.m @@ -249,28 +249,6 @@ return mask; } -//- (CGAffineTransform)absoluteTransform:(IJSVGNode *)node -//{ -// CGAffineTransform parentAbsoluteTransform = CGAffineTransformIdentity; -// IJSVGNode * intermediateNode = node.intermediateParentNode; -// IJSVGNode * parentSVGNode = node; -// while(node != nil) { -// // intermediateParent should be skipped as these are elements -// // created by use statements and are technically fake elements, but the -// // spec says use them for the transforms, yolo! -// if(node == intermediateNode) { -// node = node.parentNode; -// continue; -// } -// CGAffineTransform trans = IJSVGConcatTransforms(node.transforms); -// parentAbsoluteTransform = CGAffineTransformConcat(trans,parentAbsoluteTransform); -// node = node.parentNode; -// } -// return parentAbsoluteTransform; -//} - - - - (CGAffineTransform)absoluteTransform:(IJSVGNode *)node { CGAffineTransform parentAbsoluteTransform = CGAffineTransformIdentity; diff --git a/source/IJSVGRadialGradient.m b/source/IJSVGRadialGradient.m index b847097..2018b6f 100644 --- a/source/IJSVGRadialGradient.m +++ b/source/IJSVGRadialGradient.m @@ -50,7 +50,11 @@ NSString * str = [element attributeForName:key].stringValue; IJSVGUnitLength * unit = nil; if(str != nil) { - unit = [IJSVGUnitLength unitWithString:str]; + if(gradient.units == IJSVGUnitObjectBoundingBox) { + unit = [IJSVGUnitLength unitWithPercentageString:str]; + } else { + unit = [IJSVGUnitLength unitWithString:str]; + } } else { unit = [IJSVGUnitLength unitWithPercentageFloat:.5f]; } @@ -64,7 +68,7 @@ // needs fixing NSString * fx = [element attributeForName:@"fx"].stringValue; if(fx != nil) { - if(fx.floatValue < 1.f) { + if(gradient.units == IJSVGUnitObjectBoundingBox) { gradient.fx = [IJSVGUnitLength unitWithPercentageString:fx]; } else { gradient.fx = [IJSVGUnitLength unitWithString:fx]; @@ -73,7 +77,7 @@ NSString * fy = [element attributeForName:@"fy"].stringValue; if(fx != nil) { - if(fx.floatValue < 1.f) { + if(gradient.units == IJSVGUnitObjectBoundingBox) { gradient.fy = [IJSVGUnitLength unitWithPercentageString:fy]; } else { gradient.fy = [IJSVGUnitLength unitWithString:fy]; @@ -152,7 +156,8 @@ kCGGradientDrawsBeforeStartLocation| kCGGradientDrawsAfterEndLocation; CGContextDrawRadialGradient(ctx, self.CGGradient, - gradientEndPoint, 0, gradientStartPoint, + gradientEndPoint, 0, + gradientStartPoint, radius, options); #ifdef IJSVG_DEBUG_GRADIENTS