From 6c0507abe677685d0ea19b228fcfc0fad62f73f6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 22 Aug 2019 14:45:49 +1000 Subject: [PATCH] tools: use the json file timestamp where the strokes have none Cause for the issue in #179 Signed-off-by: Peter Hutterer --- tools/test-svg.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/test-svg.py b/tools/test-svg.py index 8aedc6a..a3a2171 100755 --- a/tools/test-svg.py +++ b/tools/test-svg.py @@ -61,12 +61,15 @@ def parse_file(filename, tablet_model, orientation): return f = StrokeFile(data) + # Spark doesn't have timestamps in the strokes, so use the file + # timestamp itself + timestamp = f.timestamp or yml['time'] # gotta convert to Drawings, then to json string, then to json, then # to svg. ffs. svgname = f'{stem}.svg' jsonname = f'{stem}.json' ps = 5 # FIXME: fetch the point size from the settings.ini - d = Drawing(svgname, (width * ps, height * ps), f.timestamp) + d = Drawing(svgname, (width * ps, height * ps), timestamp) def normalize(p): NORMALIZED_RANGE = 0x10000