Android - Use a different variable to save the reported dpi by qt in TouchscreenVirtualPadDevice

This commit is contained in:
Cristian Luis Duarte 2018-03-05 18:08:06 -03:00
parent c091bc0bb3
commit 0bb56d837d
2 changed files with 3 additions and 1 deletions

View file

@ -43,10 +43,11 @@ void TouchscreenVirtualPadDevice::init() {
_fixedPosition = true; // This should be config _fixedPosition = true; // This should be config
QScreen* eventScreen = qApp->primaryScreen(); QScreen* eventScreen = qApp->primaryScreen();
if (_screenDPI != eventScreen->physicalDotsPerInch()) { if (_screenDPIProvided != eventScreen->physicalDotsPerInch()) {
_screenWidthCenter = eventScreen->size().width() / 2; _screenWidthCenter = eventScreen->size().width() / 2;
_screenDPIScale.x = (float)eventScreen->physicalDotsPerInchX(); _screenDPIScale.x = (float)eventScreen->physicalDotsPerInchX();
_screenDPIScale.y = (float)eventScreen->physicalDotsPerInchY(); _screenDPIScale.y = (float)eventScreen->physicalDotsPerInchY();
_screenDPIProvided = eventScreen->physicalDotsPerInch();
_screenDPI = eventScreen->physicalDotsPerInch(); _screenDPI = eventScreen->physicalDotsPerInch();
_fixedRadius = _screenDPI * 256 / 534; _fixedRadius = _screenDPI * 256 / 534;

View file

@ -65,6 +65,7 @@ protected:
float _lastPinchScale; float _lastPinchScale;
float _pinchScale; float _pinchScale;
float _screenDPI; float _screenDPI;
qreal _screenDPIProvided;
glm::vec2 _screenDPIScale; glm::vec2 _screenDPIScale;
bool _validTouchLeft; bool _validTouchLeft;
glm::vec2 _firstTouchLeftPoint; glm::vec2 _firstTouchLeftPoint;