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

Method drawShape

src/core/HitTestContext.cpp:99–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void HitTestContext::drawShape(std::shared_ptr<Shape> shape, const MCState& state,
100 const Fill& fill) {
101 DEBUG_ASSERT(shape != nullptr);
102 Point local = {};
103 if (!GetLocalPoint(state.matrix, deviceX, deviceY, &local)) {
104 return;
105 }
106 if (shapeHitTest) {
107 auto path = shape->getPath();
108 if (!path.contains(local.x, local.y)) {
109 return;
110 }
111 } else {
112 auto bounds = shape->getBounds();
113 if (!bounds.contains(local.x, local.y)) {
114 return;
115 }
116 }
117 if (checkClipAndFill(state.clip, fill, local)) {
118 hit = true;
119 }
120}
121
122void HitTestContext::drawImage(std::shared_ptr<Image> image, const SamplingOptions&,
123 const MCState& state, const Fill& fill) {

Callers

nothing calls this directly

Calls 4

GetLocalPointFunction · 0.85
getPathMethod · 0.45
containsMethod · 0.45
getBoundsMethod · 0.45

Tested by

no test coverage detected