MCPcopy Create free account
hub / github.com/arrayfire/forge / findTransform

Method findTransform

src/backend/opengl/sdl/window.cpp:44–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44const glm::mat4 Widget::findTransform(const MatrixHashMap& pMap, const float pX, const float pY)
45{
46 for (auto it: pMap) {
47 const CellIndex& idx = it.first;
48 const glm::mat4& mat = it.second;
49
50 const int rows = std::get<0>(idx);
51 const int cols = std::get<1>(idx);
52
53 const int cellWidth = mWidth/cols;
54 const int cellHeight = mHeight/rows;
55
56 const int x = int(pX) / cellWidth;
57 const int y = int(pY) / cellHeight;
58 const int i = x + y * cols;
59 if (i==std::get<2>(idx)) {
60 return mat;
61 }
62 }
63
64 return IDENTITY;
65}
66
67const glm::mat4 Widget::getCellViewMatrix(const float pXPos, const float pYPos)
68{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected