From kde-commits Thu Dec 31 20:21:18 2015 From: Michael Abrahams Date: Thu, 31 Dec 2015 20:21:18 +0000 To: kde-commits Subject: [krita] krita/ui/input/wintab: Fix Wintab scaling to support QT_SCALE_FACTOR Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=145159329410001 Git commit 4bedfc347f20863f206916186d8e87bc32c0385c by Michael Abrahams. Committed on 31/12/2015 at 20:21. Pushed by abrahams into branch 'master'. Fix Wintab scaling to support QT_SCALE_FACTOR M +1 -6 krita/ui/input/wintab/kis_tablet_support_win.cpp http://commits.kde.org/krita/4bedfc347f20863f206916186d8e87bc32c0385c diff --git a/krita/ui/input/wintab/kis_tablet_support_win.cpp b/krita/ui/in= put/wintab/kis_tablet_support_win.cpp index 2e7f2b9..c732f62 100644 --- a/krita/ui/input/wintab/kis_tablet_support_win.cpp +++ b/krita/ui/input/wintab/kis_tablet_support_win.cpp @@ -758,7 +758,7 @@ bool QWindowsTabletSupport::translateTabletPacketEvent() const int z =3D currentDevice =3D=3D QTabletEvent::FourDMouse ? in= t(packet.pkZ) : 0; = // This code is to delay the tablet data one cycle to sync with th= e mouse location. - QPointF globalPosF =3D m_oldGlobalPosF; + QPointF globalPosF =3D m_oldGlobalPosF / dpr; // Convert from "nat= ive" to "device independent pixels." m_oldGlobalPosF =3D tabletData.scaleCoordinates(packet.pkX, packet= .pkY, virtualDesktopArea); = QPoint globalPos =3D globalPosF.toPoint(); @@ -818,11 +818,6 @@ bool QWindowsTabletSupport::translateTabletPacketEvent= () << tiltY << "tanP:" << tangentialPressure << "rotation:" <= < rotation; } = - // Convert from "native" to "device independent pixels" - const QPointF localPosDip =3D localPosF / dpr; - const QPointF globalPosDip =3D globalPosF / dpr; - - // Reusable helper function. Better than compiler macros! auto sendTabletEvent =3D [&](QTabletEvent::Type t){ handleTabletEvent(w, localPosDip, globalPosDip, currentDevice,= currentPointerType,