Changeset View
Changeset View
Standalone View
Standalone View
effects/cube/cube.cpp
Show First 20 Lines • Show All 222 Lines • ▼ Show 20 Line(s) | 124 | { | |||
---|---|---|---|---|---|
223 | 223 | | |||
224 | // touch borders | 224 | // touch borders | ||
225 | const QVector<ElectricBorder> relevantBorders{ElectricLeft, ElectricTop, ElectricRight, ElectricBottom}; | 225 | const QVector<ElectricBorder> relevantBorders{ElectricLeft, ElectricTop, ElectricRight, ElectricBottom}; | ||
226 | for (auto e : relevantBorders) { | 226 | for (auto e : relevantBorders) { | ||
227 | effects->unregisterTouchBorder(e, m_cubeAction); | 227 | effects->unregisterTouchBorder(e, m_cubeAction); | ||
228 | effects->unregisterTouchBorder(e, m_sphereAction); | 228 | effects->unregisterTouchBorder(e, m_sphereAction); | ||
229 | effects->unregisterTouchBorder(e, m_cylinderAction); | 229 | effects->unregisterTouchBorder(e, m_cylinderAction); | ||
230 | } | 230 | } | ||
231 | auto touchEdge = [] (const QList<int> touchBorders, QAction *action) { | 231 | auto touchEdge = [&relevantBorders] (const QList<int> touchBorders, QAction *action) { | ||
232 | for (int i : touchBorders) { | 232 | for (int i : touchBorders) { | ||
233 | if (!relevantBorders.contains(ElectricBorder(i))) { | ||||
234 | continue; | ||||
235 | } | ||||
233 | effects->registerTouchBorder(ElectricBorder(i), action); | 236 | effects->registerTouchBorder(ElectricBorder(i), action); | ||
234 | } | 237 | } | ||
235 | }; | 238 | }; | ||
236 | touchEdge(CubeConfig::touchBorderActivate(), m_cubeAction); | 239 | touchEdge(CubeConfig::touchBorderActivate(), m_cubeAction); | ||
237 | touchEdge(CubeConfig::touchBorderActivateCylinder(), m_cylinderAction); | 240 | touchEdge(CubeConfig::touchBorderActivateCylinder(), m_cylinderAction); | ||
238 | touchEdge(CubeConfig::touchBorderActivateSphere(), m_sphereAction); | 241 | touchEdge(CubeConfig::touchBorderActivateSphere(), m_sphereAction); | ||
239 | } | 242 | } | ||
240 | 243 | | |||
▲ Show 20 Lines • Show All 1678 Lines • Show Last 20 Lines |