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

Method drawImage

src/core/HitTestContext.cpp:122–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void HitTestContext::drawImage(std::shared_ptr<Image> image, const SamplingOptions&,
123 const MCState& state, const Fill& fill) {
124 // Images are always checked against their bounding box.
125 Point local = {};
126 if (!GetLocalPoint(state.matrix, deviceX, deviceY, &local)) {
127 return;
128 }
129 auto imageBounds = Rect::MakeWH(image->width(), image->height());
130 if (imageBounds.contains(local.x, local.y) && checkClipAndFill(state.clip, fill, local)) {
131 hit = true;
132 }
133}
134
135void HitTestContext::drawImageRect(std::shared_ptr<Image>, const Rect&, const Rect& dstRect,
136 const SamplingOptions&, const MCState& state, const Fill& fill,

Callers

nothing calls this directly

Calls 4

GetLocalPointFunction · 0.85
widthMethod · 0.45
heightMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected