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

Method setTransform

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

Source from the content-addressed store, hash-verified

75}
76
77void Widget::setTransform(MatrixHashMap& pMap, const float pX, const float pY, const glm::mat4 &pMat)
78{
79 for (auto it: pMap) {
80 const CellIndex& idx = it.first;
81
82 const int rows = std::get<0>(idx);
83 const int cols = std::get<1>(idx);
84
85 const int cellWidth = mWidth/cols;
86 const int cellHeight = mHeight/rows;
87
88 const int x = int(pX) / cellWidth;
89 const int y = int(pY) / cellHeight;
90 const int i = x + y * cols;
91 if (i==std::get<2>(idx)) {
92 pMap[idx] = pMat;
93 }
94 }
95}
96
97void Widget::setCellViewMatrix(const float pXPos, const float pYPos, const glm::mat4& pMatrix)
98{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected