From 6b623132e5c7f2b62e2d5ee7ecf0fe18c3812e2c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 19 Jul 2019 13:52:04 +1000 Subject: [PATCH] gui: handle the now-normalized pressure range Signed-off-by: Peter Hutterer --- tuhigui/svg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tuhigui/svg.py b/tuhigui/svg.py index 64dd386..13fdd8a 100644 --- a/tuhigui/svg.py +++ b/tuhigui/svg.py @@ -66,7 +66,8 @@ class JsonSvg(GObject.Object): 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))