MCPcopy Create free account
hub / github.com/Tencent/libpag / AppendPathData

Function AppendPathData

src/rendering/renderers/TextPathRender.cpp:89–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89static 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
112static std::unique_ptr<tgfx::PathMeasure> CreatePath(const PathData& pathData, float first,
113 float end) {

Callers 1

CreatePathFunction · 0.85

Calls 2

emptyMethod · 0.80
insertMethod · 0.80

Tested by

no test coverage detected