| 42 | } |
| 43 | |
| 44 | const 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 | |
| 67 | const glm::mat4 Widget::getCellViewMatrix(const float pXPos, const float pYPos) |
| 68 | { |
nothing calls this directly
no outgoing calls
no test coverage detected