MCPcopy Create free account
hub / github.com/Tencent/tgfx / MakeTrim

Method MakeTrim

src/core/TrimPathEffect.cpp:26–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24using namespace pk;
25
26std::shared_ptr<PathEffect> PathEffect::MakeTrim(float startT, float stopT) {
27 if (isnan(startT) || isnan(stopT)) {
28 return nullptr;
29 }
30 if (startT <= 0 && stopT >= 1) {
31 return nullptr;
32 }
33 startT = std::max(0.f, std::min(startT, 1.f));
34 stopT = std::max(0.f, std::min(stopT, 1.f));
35 return std::shared_ptr<PathEffect>(new TrimPathEffect(startT, stopT));
36}
37
38bool TrimPathEffect::filterPath(Path* path) const {
39 if (path == nullptr) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected