| 65 | } |
| 66 | |
| 67 | void ExpandPath(tgfx::Path* path, float expansion) { |
| 68 | if (expansion == 0) { |
| 69 | return; |
| 70 | } |
| 71 | auto strokePath = *path; |
| 72 | tgfx::Stroke stroke(fabsf(expansion) * 2, tgfx::LineCap::Butt, tgfx::LineJoin::Round); |
| 73 | stroke.applyToPath(&strokePath); |
| 74 | if (expansion < 0) { |
| 75 | path->addPath(strokePath, tgfx::PathOp::Difference); |
| 76 | } else { |
| 77 | path->addPath(strokePath, tgfx::PathOp::Union); |
| 78 | } |
| 79 | } |
| 80 | } // namespace pag |
no test coverage detected