GenerallyHelpfulSoftware / SVGgh

A framework for using SVG artwork in iOS Apps. Includes a UIView and a button class, printing and PDF export.
MIT License
141 stars 37 forks source link

maxBoundingBoxForSVGPath infinite loop #10

Closed taher-mosbah closed 9 years ago

taher-mosbah commented 9 years ago

Hello, I'm trying to use maxBoundingBoxForSVGPath on the following svg path (valid svg, I double checked with online tools and svg viewers) : <path fill="#F7931E" stroke="#F7931E" d="M1470.7,557.7L1631.3 459 1699.3 571.7 1535.3 666.3 z"></path> but the while loop seems to never end. Thank you.

taher-mosbah commented 9 years ago

I think the idea is to manually parse the SVG file and extract the Path value.

grhowes commented 9 years ago

Did you end up converting to a CGPathRef and call CGPathGetPathBoundingBox or CGPathGetBoundingBox?

taher-mosbah commented 9 years ago

I ended up extracting the d in Path from the xml and using CGPathGetPathBoundingBox