(str, opts)
| 15526 | |
| 15527 | // TODO Optimize double memory cost problem |
| 15528 | function createPathOptions(str, opts) { |
| 15529 | var pathProxy = createPathProxyFromString(str); |
| 15530 | opts = opts || {}; |
| 15531 | opts.buildPath = function (path) { |
| 15532 | if (path.setData) { |
| 15533 | path.setData(pathProxy.data); |
| 15534 | // Svg and vml renderer don't have context |
| 15535 | var ctx = path.getContext(); |
| 15536 | if (ctx) { |
| 15537 | path.rebuildPath(ctx); |
| 15538 | } |
| 15539 | } |
| 15540 | else { |
| 15541 | var ctx = path; |
| 15542 | pathProxy.rebuildPath(ctx); |
| 15543 | } |
| 15544 | }; |
| 15545 | |
| 15546 | opts.applyTransform = function (m) { |
| 15547 | transformPath(pathProxy, m); |
| 15548 | this.dirty(true); |
| 15549 | }; |
| 15550 | |
| 15551 | return opts; |
| 15552 | } |
| 15553 | |
| 15554 | /** |
| 15555 | * Create a Path object from path string data |
no test coverage detected