Kevin Lubick | 54c1b3d | 2020-10-07 16:09:22 -0400 | [diff] [blame] | 1 | // Adds in the code to use pathops with Path |
Kevin Lubick | 933ea8c | 2020-01-06 08:10:05 -0500 | [diff] [blame] | 2 | CanvasKit._extraInitializations = CanvasKit._extraInitializations || []; |
| 3 | CanvasKit._extraInitializations.push(function() { |
Kevin Lubick | 54c1b3d | 2020-10-07 16:09:22 -0400 | [diff] [blame] | 4 | CanvasKit.Path.prototype.op = function(otherPath, op) { |
Kevin Lubick | 933ea8c | 2020-01-06 08:10:05 -0500 | [diff] [blame] | 5 | if (this._op(otherPath, op)) { |
| 6 | return this; |
| 7 | } |
| 8 | return null; |
| 9 | }; |
| 10 | |
Kevin Lubick | 54c1b3d | 2020-10-07 16:09:22 -0400 | [diff] [blame] | 11 | CanvasKit.Path.prototype.simplify = function() { |
Kevin Lubick | 933ea8c | 2020-01-06 08:10:05 -0500 | [diff] [blame] | 12 | if (this._simplify()) { |
| 13 | return this; |
| 14 | } |
| 15 | return null; |
| 16 | }; |
Kevin Lubick | 54c1b3d | 2020-10-07 16:09:22 -0400 | [diff] [blame] | 17 | }); |