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

Function GetScaleFactor

src/base/utils/MatrixUtil.cpp:37–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37tgfx::Point GetScaleFactor(const tgfx::Matrix& matrix, float contentScale, bool inverted) {
38 auto scale = matrix.getAxisScales();
39 scale.x *= contentScale;
40 scale.y *= contentScale;
41 if (inverted) {
42 scale.x = scale.x == 0 ? 0 : 1 / scale.x;
43 scale.y = scale.y == 0 ? 0 : 1 / scale.y;
44 }
45 return scale;
46}
47
48} // namespace pag

Callers 1

GetMaxScaleFactorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected