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

Method findTransform

src/backend/opengl/glfw/window.cpp:47–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected