From 97e90ed798625bb9b06a81cefc32453a70cd310f Mon Sep 17 00:00:00 2001 From: Triplelexx Date: Wed, 29 Jun 2016 03:45:54 +0100 Subject: [PATCH] TouchscreenDevice DPI scaling now handled via JSON mapping do the arbitrary scaling in the mapping file --- interface/resources/controllers/touchscreen.json | 4 ++-- .../input-plugins/src/input-plugins/TouchscreenDevice.cpp | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/interface/resources/controllers/touchscreen.json b/interface/resources/controllers/touchscreen.json index 21362ce8fb..5b2ff62a8d 100644 --- a/interface/resources/controllers/touchscreen.json +++ b/interface/resources/controllers/touchscreen.json @@ -9,7 +9,7 @@ [ "Touchscreen.DragRight" ] ] }, - "to": "Actions.Yaw" + "to": "Actions.Yaw", "filters": [ { "type": "scale", "scale": 0.12 } ] }, { "from": { "makeAxis" : [ @@ -17,7 +17,7 @@ [ "Touchscreen.DragDown" ] ] }, - "to": "Actions.Pitch" + "to": "Actions.Pitch", "filters": [ { "type": "scale", "scale": 0.04 } ] } ] } diff --git a/libraries/input-plugins/src/input-plugins/TouchscreenDevice.cpp b/libraries/input-plugins/src/input-plugins/TouchscreenDevice.cpp index e9553c1785..271a3bb732 100644 --- a/libraries/input-plugins/src/input-plugins/TouchscreenDevice.cpp +++ b/libraries/input-plugins/src/input-plugins/TouchscreenDevice.cpp @@ -77,12 +77,6 @@ void TouchscreenDevice::touchBeginEvent(const QTouchEvent* event) { _firstTouchVec = glm::vec2(point.pos().x(), point.pos().y()); KeyboardMouseDevice::enableTouch(false); if (_screenDPI != event->window()->screen()->physicalDotsPerInch()) { - // at DPI 100 use these arbitrary values to divide dragging distance - // the value is clamped from 1 to 10 so up to 1000 DPI would be supported atm - _screenDPIScale.x = glm::clamp((float)(qApp->primaryScreen()->physicalDotsPerInchX() / 100.0), 1.0f, 10.0f) - * 600.0f; - _screenDPIScale.y = glm::clamp((float)(qApp->primaryScreen()->physicalDotsPerInchY() / 100.0), 1.0f, 10.0f) - * 200.0f; _screenDPI = event->window()->screen()->physicalDotsPerInch(); } }