tools: use the json file timestamp where the strokes have none

Cause for the issue in #179

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-08-22 14:45:49 +10:00
parent 06aa5b05b1
commit 6c0507abe6
1 changed files with 4 additions and 1 deletions

View File

@ -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