diff --git a/tools/kete.py b/tools/kete.py index 9810c7d..751493a 100755 --- a/tools/kete.py +++ b/tools/kete.py @@ -629,7 +629,8 @@ class Fetcher(Worker): elif self.orientation == 'Reverse-Landscape': x, y = width - x, height - y - delta = (p['pressure'] - 1000.0) / 1000.0 + # Pressure normalized range is [0, 0xffff] + delta = (p['pressure'] - 0x8000) / 0x8000 stroke_width = 0.4 + 0.20 * delta points_with_sk_width.append((x, y, stroke_width)) diff --git a/tuhi/wacom.py b/tuhi/wacom.py index 67eaf24..9ca68f9 100644 --- a/tuhi/wacom.py +++ b/tuhi/wacom.py @@ -963,7 +963,11 @@ class WacomProtocolBase(WacomProtocolLowLevelComm): if packet.bitmask & 0b00111100 == 0: continue - stroke.new_abs((x, y), p) + def normalize(p): + NORMALIZED_RANGE = 0x10000 + return NORMALIZED_RANGE * p / self.pressure + + stroke.new_abs((x, y), normalize(p)) drawing.seal() return drawing