From 9db45c01cc9560bf480f3d6e5b6f49c13ac4e271 Mon Sep 17 00:00:00 2001 From: Triplelexx Date: Wed, 3 Feb 2016 00:13:45 +0000 Subject: [PATCH] indentation fixes caught some inconsistencies --- .../src/input-plugins/TouchscreenDevice.cpp | 27 +++++++++---------- .../src/input-plugins/TouchscreenDevice.h | 6 ++--- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/libraries/input-plugins/src/input-plugins/TouchscreenDevice.cpp b/libraries/input-plugins/src/input-plugins/TouchscreenDevice.cpp index 987ff2cac4..788a75dc76 100644 --- a/libraries/input-plugins/src/input-plugins/TouchscreenDevice.cpp +++ b/libraries/input-plugins/src/input-plugins/TouchscreenDevice.cpp @@ -76,17 +76,16 @@ void TouchscreenDevice::touchUpdateEvent(const QTouchEvent* event) { } void TouchscreenDevice::touchGestureEvent(const QGestureEvent* event) { - // pinch gesture - if (QGesture* gesture = event->gesture(Qt::PinchGesture)) { - QPinchGesture* pinch = static_cast(gesture); - qreal scaleFactor = pinch->totalScaleFactor(); - if (scaleFactor > _lastPinchScale && scaleFactor != 0) { - _inputDevice->_axisStateMap[_inputDevice->makeInput(TOUCH_GESTURE_PINCH_POS).getChannel()] = 1.0f; - } else if (scaleFactor != 0) { - _inputDevice->_axisStateMap[_inputDevice->makeInput(TOUCH_GESTURE_PINCH_NEG).getChannel()] = 1.0f; - } - _lastPinchScale = scaleFactor; - } + if (QGesture* gesture = event->gesture(Qt::PinchGesture)) { + QPinchGesture* pinch = static_cast(gesture); + qreal scaleFactor = pinch->totalScaleFactor(); + if (scaleFactor > _lastPinchScale && scaleFactor != 0) { + _inputDevice->_axisStateMap[_inputDevice->makeInput(TOUCH_GESTURE_PINCH_POS).getChannel()] = 1.0f; + } else if (scaleFactor != 0) { + _inputDevice->_axisStateMap[_inputDevice->makeInput(TOUCH_GESTURE_PINCH_NEG).getChannel()] = 1.0f; + } + _lastPinchScale = scaleFactor; + } } controller::Input TouchscreenDevice::InputDevice::makeInput(TouchscreenDevice::TouchAxisChannel axis) const { @@ -94,7 +93,7 @@ controller::Input TouchscreenDevice::InputDevice::makeInput(TouchscreenDevice::T } controller::Input TouchscreenDevice::InputDevice::makeInput(TouchscreenDevice::TouchGestureAxisChannel gesture) const { - return controller::Input(_deviceID, gesture, controller::ChannelType::AXIS); + return controller::Input(_deviceID, gesture, controller::ChannelType::AXIS); } controller::Input::NamedVector TouchscreenDevice::InputDevice::getAvailableInputs() const { @@ -107,8 +106,8 @@ controller::Input::NamedVector TouchscreenDevice::InputDevice::getAvailableInput availableInputs.append(Input::NamedPair(makeInput(TOUCH_AXIS_Y_POS), "DragUp")); availableInputs.append(Input::NamedPair(makeInput(TOUCH_AXIS_Y_NEG), "DragDown")); - availableInputs.append(Input::NamedPair(makeInput(TOUCH_GESTURE_PINCH_POS), "GesturePinchOut")); - availableInputs.append(Input::NamedPair(makeInput(TOUCH_GESTURE_PINCH_NEG), "GesturePinchIn")); + availableInputs.append(Input::NamedPair(makeInput(TOUCH_GESTURE_PINCH_POS), "GesturePinchOut")); + availableInputs.append(Input::NamedPair(makeInput(TOUCH_GESTURE_PINCH_NEG), "GesturePinchIn")); }); return availableInputs; } diff --git a/libraries/input-plugins/src/input-plugins/TouchscreenDevice.h b/libraries/input-plugins/src/input-plugins/TouchscreenDevice.h index c0d1ec0112..8cc59c2532 100644 --- a/libraries/input-plugins/src/input-plugins/TouchscreenDevice.h +++ b/libraries/input-plugins/src/input-plugins/TouchscreenDevice.h @@ -31,7 +31,7 @@ public: enum TouchGestureAxisChannel { TOUCH_GESTURE_PINCH_POS = TOUCH_AXIS_Y_NEG + 1, - TOUCH_GESTURE_PINCH_NEG, + TOUCH_GESTURE_PINCH_NEG, }; // Plugin functions @@ -45,7 +45,7 @@ public: void touchBeginEvent(const QTouchEvent* event); void touchEndEvent(const QTouchEvent* event); void touchUpdateEvent(const QTouchEvent* event); - void touchGestureEvent(const QGestureEvent* event); + void touchGestureEvent(const QGestureEvent* event); static const QString NAME; @@ -62,7 +62,7 @@ protected: virtual void focusOutEvent() override; controller::Input makeInput(TouchAxisChannel axis) const; - controller::Input makeInput(TouchGestureAxisChannel gesture) const; + controller::Input makeInput(TouchGestureAxisChannel gesture) const; friend class TouchscreenDevice; };