mirror of
https://github.com/citra-emu/citra-nightly.git
synced 2025-10-04 15:27:10 +00:00
various minor style and code improvements
This commit is contained in:
parent
de0d6f6791
commit
1341b47242
|
@ -257,23 +257,22 @@ void GRenderWindow::touchBeginEvent(QTouchEvent* event) {
|
|||
}
|
||||
|
||||
void GRenderWindow::touchUpdateEvent(QTouchEvent* event) {
|
||||
qreal x = 0.0, y = 0.0;
|
||||
int activePoints = 0;
|
||||
auto points = event->touchPoints();
|
||||
|
||||
for (int i = 0; i < points.count(); i++) {
|
||||
auto tp = points[i];
|
||||
qreal x = 0.0;
|
||||
qreal y = 0.0;
|
||||
int active_points = 0;
|
||||
const auto points = event->touchPoints();
|
||||
|
||||
for (const auto tp : event->touchPoints()) {
|
||||
if (tp.state() & (Qt::TouchPointPressed | Qt::TouchPointMoved | Qt::TouchPointStationary)) {
|
||||
activePoints++;
|
||||
active_points++;
|
||||
|
||||
x += tp.pos().x();
|
||||
y += tp.pos().y();
|
||||
}
|
||||
}
|
||||
|
||||
x /= activePoints;
|
||||
y /= activePoints;
|
||||
x /= active_points;
|
||||
y /= active_points;
|
||||
|
||||
// Copied from mouseMoveEvent:
|
||||
qreal pixelRatio = windowPixelRatio();
|
||||
|
|
Loading…
Reference in a new issue