| 87 | } |
| 88 | |
| 89 | static void AppendPathData(PathData& pathData, const PathData& source) { |
| 90 | if (source.verbs.empty()) { |
| 91 | return; |
| 92 | } |
| 93 | |
| 94 | auto pointsBegin = source.points.begin(); |
| 95 | auto verbsBegin = source.verbs.begin(); |
| 96 | |
| 97 | // 仅当首个路径指令是 move 开头,忽略指令 |
| 98 | if (*verbsBegin == PathDataVerb::MoveTo && !source.points.empty()) { |
| 99 | verbsBegin++; |
| 100 | pointsBegin++; |
| 101 | } |
| 102 | |
| 103 | if (verbsBegin != source.verbs.end()) { |
| 104 | pathData.verbs.insert(pathData.verbs.end(), verbsBegin, source.verbs.end()); |
| 105 | } |
| 106 | |
| 107 | if (pointsBegin != source.points.end()) { |
| 108 | pathData.points.insert(pathData.points.end(), pointsBegin, source.points.end()); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | static std::unique_ptr<tgfx::PathMeasure> CreatePath(const PathData& pathData, float first, |
| 113 | float end) { |
no test coverage detected